@metamask/ramps-controller 18.0.1 → 19.0.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/dist/RampsController-method-action-types.cjs.map +1 -1
  3. package/dist/RampsController-method-action-types.d.cts +30 -1
  4. package/dist/RampsController-method-action-types.d.cts.map +1 -1
  5. package/dist/RampsController-method-action-types.d.mts +30 -1
  6. package/dist/RampsController-method-action-types.d.mts.map +1 -1
  7. package/dist/RampsController-method-action-types.mjs.map +1 -1
  8. package/dist/RampsController.cjs +60 -18
  9. package/dist/RampsController.cjs.map +1 -1
  10. package/dist/RampsController.d.cts +31 -17
  11. package/dist/RampsController.d.cts.map +1 -1
  12. package/dist/RampsController.d.mts +31 -17
  13. package/dist/RampsController.d.mts.map +1 -1
  14. package/dist/RampsController.mjs +61 -19
  15. package/dist/RampsController.mjs.map +1 -1
  16. package/dist/RampsService-method-action-types.cjs.map +1 -1
  17. package/dist/RampsService-method-action-types.d.cts +31 -1
  18. package/dist/RampsService-method-action-types.d.cts.map +1 -1
  19. package/dist/RampsService-method-action-types.d.mts +31 -1
  20. package/dist/RampsService-method-action-types.d.mts.map +1 -1
  21. package/dist/RampsService-method-action-types.mjs.map +1 -1
  22. package/dist/RampsService.cjs +75 -1
  23. package/dist/RampsService.cjs.map +1 -1
  24. package/dist/RampsService.d.cts +52 -0
  25. package/dist/RampsService.d.cts.map +1 -1
  26. package/dist/RampsService.d.mts +52 -0
  27. package/dist/RampsService.d.mts.map +1 -1
  28. package/dist/RampsService.mjs +73 -0
  29. package/dist/RampsService.mjs.map +1 -1
  30. package/dist/index.cjs +2 -1
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.cts +3 -3
  33. package/dist/index.d.cts.map +1 -1
  34. package/dist/index.d.mts +3 -3
  35. package/dist/index.d.mts.map +1 -1
  36. package/dist/index.mjs +1 -1
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/providerAvailability.cjs +1 -1
  39. package/dist/providerAvailability.cjs.map +1 -1
  40. package/dist/providerAvailability.d.cts.map +1 -1
  41. package/dist/providerAvailability.d.mts.map +1 -1
  42. package/dist/providerAvailability.mjs +1 -1
  43. package/dist/providerAvailability.mjs.map +1 -1
  44. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [19.0.0]
11
+
12
+ ### Added
13
+
14
+ - Add `setSelectedProviderForAsset(assetId, options?)` method and `RampsController:setSelectedProviderForAsset` messenger action ([#9759](https://github.com/MetaMask/core/pull/9759))
15
+ - Switches `providers.selected` to the first provider in `providers.data` that serves the given CAIP-19 asset when the currently selected provider does not, using the existing `providerServesAsset` utility.
16
+ - Returns `true` if a switch was made, `false` otherwise (no-op when providers are not yet loaded, the current provider already serves the asset, or no alternative provider serves the asset).
17
+ - Add `RampsService.getDefaultRedirectCallbackUrl()` and the matching `RampsService:getDefaultRedirectCallbackUrl` messenger action (plus the exported `RampsServiceGetDefaultRedirectCallbackUrlAction` type), which return the widened Headless Buy default redirect ("fake callback") URL for the environment the service was constructed with. The method is synchronous. ([#9752](https://github.com/MetaMask/core/pull/9752))
18
+ - `baseUrlOverride` deliberately does not apply. It overrides the ramps API host for local development, which in production and staging is not the host that serves `/regions/fake-callback` (`on-ramp-content` versus `on-ramp{-cache}`), and the redirect URL is matched by client UI to detect flow completion. For development the callback already shares the API host family (`on-ramp.dev-api`). Use `RampsEnvironment.Local` for a localhost callback, noting it is pinned to `http://localhost:3000` and does not follow a non-3000 `baseUrlOverride`.
19
+ - Add the exported `getDefaultRedirectCallbackUrl(environment)` helper, the canonical environment-to-callback map that `RampsService` uses: `on-ramp-content` hosts for production and staging, `on-ramp.dev-api` for development (there is no `on-ramp-content.dev-api` deployment), and `localhost:3000` for local. Client code that needs the value synchronously, without the messenger, can call it directly with the same environment the service was given. ([#9752](https://github.com/MetaMask/core/pull/9752))
20
+
21
+ ### Changed
22
+
23
+ - **BREAKING:** `RampsController` now calls `RampsService:getDefaultRedirectCallbackUrl` on the widened quote path, so hosts must delegate that action to the controller's messenger. It is included in the exported `RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS` list; hosts that spell out their delegated action list instead of spreading that constant have to add it, or the entire `RampsController:getQuotes` call rejects with a messenger "handler has not been delegated" error (including MM Pay's fiat quote path, which omits `redirectUrl` and relies on widening). ([#9752](https://github.com/MetaMask/core/pull/9752))
24
+ - The action is only called when the `moneyHeadlessAllProviders` widening is in effect and the caller omitted `redirectUrl`. An explicit `redirectUrl` and the native-only path never reach the service.
25
+
26
+ ### Removed
27
+
28
+ - **BREAKING:** Remove the `getDefaultRedirectUrl` callback option from `RampsControllerOptions`. The controller asks `RampsService` for the default redirect URL instead, which keeps the environment a single runtime source of truth so the callback host cannot drift from the API host the service is talking to. ([#9752](https://github.com/MetaMask/core/pull/9752))
29
+ - Mobile should drop the `getDefaultRedirectUrl: () => getRampCallbackBaseUrl()` argument from its `RampsController` init once it upgrades, and reimplement `getRampCallbackBaseUrl()` as `getDefaultRedirectCallbackUrl(getRampsEnvironment())` so the UI callback matcher and the controller default resolve from the same environment source.
30
+
31
+ ### Fixed
32
+
33
+ - Fix `providerServesAsset` to require the `supportedCryptoCurrencies` map value to be `true`, not just key presence ([#9759](https://github.com/MetaMask/core/pull/9759))
34
+ - Previously a provider with `{ "eip155:1/erc20:0x...": false }` would be treated as serving the asset.
35
+
10
36
  ## [18.0.1]
11
37
 
12
38
  ### Changed
@@ -480,7 +506,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
480
506
  - Add `OnRampService` for interacting with the OnRamp API
481
507
  - Add geolocation detection via IP address lookup
482
508
 
483
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@18.0.1...HEAD
509
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@19.0.0...HEAD
510
+ [19.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@18.0.1...@metamask/ramps-controller@19.0.0
484
511
  [18.0.1]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@18.0.0...@metamask/ramps-controller@18.0.1
485
512
  [18.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@17.2.0...@metamask/ramps-controller@18.0.0
486
513
  [17.2.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@17.1.0...@metamask/ramps-controller@17.2.0
@@ -1 +1 @@
1
- {"version":3,"file":"RampsController-method-action-types.cjs","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController.js';\n\n/**\n * Executes a request with caching, deduplication, and at most one in-flight\n * request per resource type.\n *\n * 1. **Same cache key in flight** – If a request with this cache key is\n * already pending, returns that promise (deduplication; no second request).\n *\n * 2. **Cache hit** – If valid, non-expired data exists in state.requests for\n * this key and forceRefresh is not set, returns that data without fetching.\n *\n * 3. **New request** – Creates an AbortController and fires the fetcher.\n * If options.resourceType is set, tags the pending request with that\n * resource type (so #abortDependentRequests can cancel it on region\n * change or cleanup) and ref-counts resource-level loading state.\n * On success or error, updates request state and resource error;\n * in finally, clears resource loading only if this request was not\n * aborted.\n *\n * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).\n * @param fetcher - Async function that performs the fetch. Receives an AbortSignal\n * that is aborted when this request is superseded by another for the same resource.\n * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.\n * @returns The result of the request (from cache, joined promise, or fetcher).\n */\nexport type RampsControllerExecuteRequestAction = {\n type: `RampsController:executeRequest`;\n handler: RampsController['executeRequest'];\n};\n\n/**\n * Aborts a pending request if one exists.\n *\n * @param cacheKey - The cache key of the request to abort.\n * @returns True if a request was aborted.\n */\nexport type RampsControllerAbortRequestAction = {\n type: `RampsController:abortRequest`;\n handler: RampsController['abortRequest'];\n};\n\n/**\n * Gets the state of a specific cached request.\n *\n * @param cacheKey - The cache key to look up.\n * @returns The request state, or undefined if not cached.\n */\nexport type RampsControllerGetRequestStateAction = {\n type: `RampsController:getRequestState`;\n handler: RampsController['getRequestState'];\n};\n\n/**\n * Sets the user's region manually (without fetching geolocation).\n * This allows users to override the detected region.\n *\n * @param region - The region code to set (e.g., \"US-CA\").\n * @param options - Options for cache behavior.\n * @returns The user region object.\n */\nexport type RampsControllerSetUserRegionAction = {\n type: `RampsController:setUserRegion`;\n handler: RampsController['setUserRegion'];\n};\n\n/**\n * Sets the user's selected provider.\n *\n * Accepts either a Provider object (stored directly) or a provider ID\n * string (looked up from state). The object form is preferred when the\n * caller already has the full data (e.g. from React Query cache).\n *\n * @param providerOrId - A Provider object, a provider ID string (e.g., \"/providers/moonpay\"), or null to clear.\n * @param options - Optional settings for the selection.\n * @param options.autoSelected - When true, marks the provider as system-guessed\n * (soft selection). The UI will silently auto-switch on token conflict instead\n * of showing the \"Token Not Available\" modal. Defaults to false.\n */\nexport type RampsControllerSetSelectedProviderAction = {\n type: `RampsController:setSelectedProvider`;\n handler: RampsController['setSelectedProvider'];\n};\n\n/**\n * Initializes the controller by fetching the user's region from geolocation.\n * This should be called once at app startup to set up the initial region.\n *\n * Idempotent: subsequent calls return the same promise unless forceRefresh is set.\n * Force-refetches the countries catalog on startup (bypassing the in-session\n * request cache) so region preset amounts stay current. The catalog is not\n * persisted, so a cold start always re-fetches it regardless. Skips\n * geolocation when userRegion already exists.\n *\n * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.\n * @returns Promise that resolves when initialization is complete.\n */\nexport type RampsControllerInitAction = {\n type: `RampsController:init`;\n handler: RampsController['init'];\n};\n\n/**\n * Fetches the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * The countries are saved in the controller state once fetched.\n *\n * @param options - Options for cache behavior.\n * @returns An array of countries.\n */\nexport type RampsControllerGetCountriesAction = {\n type: `RampsController:getCountries`;\n handler: RampsController['getCountries'];\n};\n\n/**\n * Fetches the list of available tokens for a given region and action.\n * The tokens are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\nexport type RampsControllerGetTokensAction = {\n type: `RampsController:getTokens`;\n handler: RampsController['getTokens'];\n};\n\n/**\n * Sets the user's selected token by asset ID.\n * Looks up the token from the current tokens in state and automatically\n * fetches payment methods for that token.\n *\n * @param assetId - The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\"), or undefined to clear.\n * @throws If region is not set, tokens are not loaded, or token is not found.\n */\nexport type RampsControllerSetSelectedTokenAction = {\n type: `RampsController:setSelectedToken`;\n handler: RampsController['setSelectedToken'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * The providers are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @param options.crypto - Crypto currency ID(s) to filter by.\n * @param options.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsControllerGetProvidersAction = {\n type: `RampsController:getProviders`;\n handler: RampsController['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given context.\n * The payment methods are saved in the controller state once fetched.\n *\n * @param region - User's region code (e.g. \"fr\", \"us-ny\").\n * @param options - Query parameters for filtering payment methods.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsControllerGetPaymentMethodsAction = {\n type: `RampsController:getPaymentMethods`;\n handler: RampsController['getPaymentMethods'];\n};\n\n/**\n * Sets the user's selected payment method.\n *\n * Accepts either a payment method ID (looked up from state) or a full\n * PaymentMethod object (stored directly). The object form is preferred\n * when the caller already has the full data (e.g. from React Query cache),\n * as it avoids depending on controller state being populated.\n *\n * @param paymentMethodOrId - A PaymentMethod object, a payment method ID string, or undefined/null to clear.\n */\nexport type RampsControllerSetSelectedPaymentMethodAction = {\n type: `RampsController:setSelectedPaymentMethod`;\n handler: RampsController['setSelectedPaymentMethod'];\n};\n\n/**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the controller's request cache; callers manage the response in local state.\n *\n * @param options - The parameters for fetching quotes.\n * @param options.region - User's region code. If not provided, uses userRegion from state.\n * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.amount - The amount (in fiat for buy, crypto for sell).\n * @param options.walletAddress - The destination wallet address.\n * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.\n * @param options.providers - Optional provider IDs to filter quotes.\n * @param options.autoSelectProvider - When true and `providers` is omitted,\n * resolves a provider that supports `assetId` for this request only (no\n * state mutation). Ignored when `providers` is passed.\n * @param options.preferredProviderIds - Optional provider IDs to prefer\n * during auto-selection, in priority order (e.g. derived by the caller\n * from completed-order history). Only used when `autoSelectProvider` is\n * true and `providers` is omitted.\n * @param options.restrictToKnownOrNativeProviders - Headless-buy v0 gating. When\n * true, auto-selection resolves only a native provider, and an explicitly\n * passed `providers` list is filtered to those supporting the region and\n * asset. If nothing qualifies, `getQuotes` returns an empty response\n * instead of quoting other providers.\n * @param options.redirectUrl - Optional redirect URL after order completion.\n * @param options.action - The ramp action type. Defaults to 'buy'.\n * @param options.forceRefresh - Whether to bypass cache.\n * @param options.ttl - Custom TTL for this request.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\nexport type RampsControllerGetQuotesAction = {\n type: `RampsController:getQuotes`;\n handler: RampsController['getQuotes'];\n};\n\n/**\n * Adds or updates a V2 order in controller state.\n * If an order with the same internal order code already exists, the incoming\n * fields are merged on top of the existing order so that fields not present\n * in the update (e.g. paymentDetails from the Transak API) are preserved.\n *\n * @param order - The RampsOrder to add or update.\n */\nexport type RampsControllerAddOrderAction = {\n type: `RampsController:addOrder`;\n handler: RampsController['addOrder'];\n};\n\n/**\n * Removes a V2 order from controller state by providerOrderId.\n *\n * @param providerOrderId - The provider order ID to remove.\n */\nexport type RampsControllerRemoveOrderAction = {\n type: `RampsController:removeOrder`;\n handler: RampsController['removeOrder'];\n};\n\n/**\n * Starts polling all pending V2 orders at a fixed interval.\n * Each poll cycle iterates orders with non-terminal statuses,\n * respects pollingSecondsMinimum and backoff from error count.\n */\nexport type RampsControllerStartOrderPollingAction = {\n type: `RampsController:startOrderPolling`;\n handler: RampsController['startOrderPolling'];\n};\n\n/**\n * Stops order polling and clears the interval.\n */\nexport type RampsControllerStopOrderPollingAction = {\n type: `RampsController:stopOrderPolling`;\n handler: RampsController['stopOrderPolling'];\n};\n\n/**\n * Fetches the widget data from a quote for redirect providers.\n * Makes a request to the buyURL endpoint via the RampsService to get the\n * actual provider widget URL and optional order ID for polling.\n *\n * @param quote - The quote to fetch the widget URL from.\n * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).\n * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.\n */\nexport type RampsControllerGetBuyWidgetDataAction = {\n type: `RampsController:getBuyWidgetData`;\n handler: RampsController['getBuyWidgetData'];\n};\n\n/**\n * Registers an order ID for polling until the order is created or resolved.\n * Adds a minimal stub order to controller state; the existing order polling\n * will fetch the full order when the provider has created it.\n *\n * @param params - Object containing order identifiers and wallet info.\n * @param params.orderId - Full order ID (e.g. \"/providers/paypal/orders/abc123\") or order code.\n * @param params.providerCode - Canonical provider code (e.g. \"paypal\", \"transak\").\n * @param params.walletAddress - Wallet address for the order.\n * @param params.chainId - Optional chain ID for the order.\n */\nexport type RampsControllerAddPrecreatedOrderAction = {\n type: `RampsController:addPrecreatedOrder`;\n handler: RampsController['addPrecreatedOrder'];\n};\n\n/**\n * Fetches an order from the unified V2 API endpoint.\n * Returns a normalized RampsOrder for all provider types (aggregator and native).\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"transak-native\", \"moonpay\").\n * @param orderCode - The order identifier.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderAction = {\n type: `RampsController:getOrder`;\n handler: RampsController['getOrder'];\n};\n\n/**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 backend for provider-specific parsing,\n * then fetches the full order. This is the V2 equivalent of the aggregator\n * SDK's `getOrderFromCallback`.\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"moonpay\").\n * @param callbackUrl - The full callback URL the provider redirected to.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderFromCallbackAction = {\n type: `RampsController:getOrderFromCallback`;\n handler: RampsController['getOrderFromCallback'];\n};\n\n/**\n * Sets the Transak API key used for all Transak API requests.\n *\n * @param apiKey - The Transak API key.\n */\nexport type RampsControllerTransakSetApiKeyAction = {\n type: `RampsController:transakSetApiKey`;\n handler: RampsController['transakSetApiKey'];\n};\n\n/**\n * Sets the Transak access token and marks the user as authenticated.\n *\n * @param token - The access token received from Transak auth.\n */\nexport type RampsControllerTransakSetAccessTokenAction = {\n type: `RampsController:transakSetAccessToken`;\n handler: RampsController['transakSetAccessToken'];\n};\n\n/**\n * Clears the Transak access token and marks the user as unauthenticated.\n */\nexport type RampsControllerTransakClearAccessTokenAction = {\n type: `RampsController:transakClearAccessToken`;\n handler: RampsController['transakClearAccessToken'];\n};\n\n/**\n * Updates the Transak authentication flag in controller state.\n *\n * @param isAuthenticated - Whether the user is authenticated with Transak.\n */\nexport type RampsControllerTransakSetAuthenticatedAction = {\n type: `RampsController:transakSetAuthenticated`;\n handler: RampsController['transakSetAuthenticated'];\n};\n\n/**\n * Resets all Transak state back to defaults (unauthenticated, no data).\n */\nexport type RampsControllerTransakResetStateAction = {\n type: `RampsController:transakResetState`;\n handler: RampsController['transakResetState'];\n};\n\n/**\n * Sends a one-time password to the user's email for Transak authentication.\n *\n * @param email - The user's email address.\n * @returns The OTP response containing a state token for verification.\n */\nexport type RampsControllerTransakSendUserOtpAction = {\n type: `RampsController:transakSendUserOtp`;\n handler: RampsController['transakSendUserOtp'];\n};\n\n/**\n * Verifies a one-time password and authenticates the user with Transak.\n * Updates the controller's authentication state on success.\n *\n * @param email - The user's email address.\n * @param verificationCode - The OTP code entered by the user.\n * @param stateToken - The state token from the sendUserOtp response.\n * @returns The access token for subsequent authenticated requests.\n */\nexport type RampsControllerTransakVerifyUserOtpAction = {\n type: `RampsController:transakVerifyUserOtp`;\n handler: RampsController['transakVerifyUserOtp'];\n};\n\n/**\n * Logs the user out of Transak. Clears authentication state and user details\n * regardless of whether the API call succeeds or fails.\n *\n * @returns A message indicating the logout result.\n */\nexport type RampsControllerTransakLogoutAction = {\n type: `RampsController:transakLogout`;\n handler: RampsController['transakLogout'];\n};\n\n/**\n * Fetches the authenticated user's details from Transak.\n * Updates the userDetails resource state with loading/success/error states.\n *\n * @returns The user's profile and KYC details.\n */\nexport type RampsControllerTransakGetUserDetailsAction = {\n type: `RampsController:transakGetUserDetails`;\n handler: RampsController['transakGetUserDetails'];\n};\n\n/**\n * Fetches a buy quote from Transak for the given parameters.\n * Updates the buyQuote resource state with loading/success/error states.\n *\n * @param fiatCurrency - The fiat currency code (e.g., \"USD\").\n * @param cryptoCurrency - The cryptocurrency identifier.\n * @param network - The blockchain network identifier.\n * @param paymentMethod - The payment method identifier.\n * @param fiatAmount - The fiat amount as a string.\n * @returns The buy quote with pricing and fee details.\n */\nexport type RampsControllerTransakGetBuyQuoteAction = {\n type: `RampsController:transakGetBuyQuote`;\n handler: RampsController['transakGetBuyQuote'];\n};\n\n/**\n * Fetches the KYC requirement for a given quote.\n * Updates the kycRequirement resource state with loading/success/error states.\n *\n * @param quoteId - The quote ID to check KYC requirements for.\n * @returns The KYC requirement status and whether the user can place an order.\n */\nexport type RampsControllerTransakGetKycRequirementAction = {\n type: `RampsController:transakGetKycRequirement`;\n handler: RampsController['transakGetKycRequirement'];\n};\n\n/**\n * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.\n *\n * @param quoteId - The quote ID to check additional requirements for.\n * @returns The list of additional forms required.\n */\nexport type RampsControllerTransakGetAdditionalRequirementsAction = {\n type: `RampsController:transakGetAdditionalRequirements`;\n handler: RampsController['transakGetAdditionalRequirements'];\n};\n\n/**\n * Creates a new order on Transak. If an existing order conflicts (HTTP 409),\n * active orders are cancelled and the creation is retried.\n *\n * @param quoteId - The quote ID to create an order from.\n * @param walletAddress - The destination wallet address.\n * @param paymentMethodId - The payment method to use.\n * @returns The created deposit order.\n */\nexport type RampsControllerTransakCreateOrderAction = {\n type: `RampsController:transakCreateOrder`;\n handler: RampsController['transakCreateOrder'];\n};\n\n/**\n * Fetches an existing order from Transak by order ID.\n *\n * @param orderId - The order ID (deposit format or raw Transak format).\n * @param wallet - The wallet address associated with the order.\n * @param paymentDetails - Optional payment details to attach to the order.\n * @returns The deposit order details.\n */\nexport type RampsControllerTransakGetOrderAction = {\n type: `RampsController:transakGetOrder`;\n handler: RampsController['transakGetOrder'];\n};\n\n/**\n * Fetches the user's spending limits for a given currency and payment method.\n *\n * @param fiatCurrency - The fiat currency code.\n * @param paymentMethod - The payment method identifier.\n * @param kycType - The KYC level type.\n * @returns The user's limits, spending, and remaining amounts.\n */\nexport type RampsControllerTransakGetUserLimitsAction = {\n type: `RampsController:transakGetUserLimits`;\n handler: RampsController['transakGetUserLimits'];\n};\n\n/**\n * Requests a one-time token (OTT) for the Transak payment widget.\n *\n * @returns The OTT response containing the token.\n */\nexport type RampsControllerTransakRequestOttAction = {\n type: `RampsController:transakRequestOtt`;\n handler: RampsController['transakRequestOtt'];\n};\n\n/**\n * Generates a URL for the Transak payment widget with pre-filled parameters.\n *\n * @param ottToken - The one-time token for widget authentication.\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional URL parameters.\n * @returns The fully constructed widget URL string.\n */\nexport type RampsControllerTransakGeneratePaymentWidgetUrlAction = {\n type: `RampsController:transakGeneratePaymentWidgetUrl`;\n handler: RampsController['transakGeneratePaymentWidgetUrl'];\n};\n\n/**\n * Creates a Transak payment widget URL via the ramps API proxy, which\n * injects the partner API key server-side. Replaces the OTT flow\n * ({@link transakRequestOtt} + {@link transakGeneratePaymentWidgetUrl}).\n *\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional widget parameters (e.g. theming).\n * @returns The single-use widget URL.\n */\nexport type RampsControllerTransakCreateWidgetUrlAction = {\n type: `RampsController:transakCreateWidgetUrl`;\n handler: RampsController['transakCreateWidgetUrl'];\n};\n\n/**\n * Submits the user's purpose of usage form for KYC compliance.\n *\n * @param purpose - Array of purpose strings selected by the user.\n * @returns A promise that resolves when the form is submitted.\n */\nexport type RampsControllerTransakSubmitPurposeOfUsageFormAction = {\n type: `RampsController:transakSubmitPurposeOfUsageForm`;\n handler: RampsController['transakSubmitPurposeOfUsageForm'];\n};\n\n/**\n * Updates the user's personal or address details on Transak.\n *\n * @param data - The user data fields to update.\n * @returns The API response data.\n */\nexport type RampsControllerTransakPatchUserAction = {\n type: `RampsController:transakPatchUser`;\n handler: RampsController['transakPatchUser'];\n};\n\n/**\n * Submits the user's SSN for identity verification.\n *\n * @param ssn - The Social Security Number.\n * @param quoteId - The quote ID associated with the order requiring SSN.\n * @returns The API response data.\n */\nexport type RampsControllerTransakSubmitSsnDetailsAction = {\n type: `RampsController:transakSubmitSsnDetails`;\n handler: RampsController['transakSubmitSsnDetails'];\n};\n\n/**\n * Confirms payment for an order after the user has completed payment.\n *\n * @param orderId - The order ID to confirm payment for.\n * @param paymentMethodId - The payment method used.\n * @returns Whether the payment confirmation was successful.\n */\nexport type RampsControllerTransakConfirmPaymentAction = {\n type: `RampsController:transakConfirmPayment`;\n handler: RampsController['transakConfirmPayment'];\n};\n\n/**\n * Translates generic ramps identifiers to Transak-specific identifiers.\n *\n * @param request - The translation request with optional identifiers to translate.\n * @returns The translated Transak-specific identifiers.\n */\nexport type RampsControllerTransakGetTranslationAction = {\n type: `RampsController:transakGetTranslation`;\n handler: RampsController['transakGetTranslation'];\n};\n\n/**\n * Checks the status of an ID proof submission for KYC.\n *\n * @param workFlowRunId - The workflow run ID to check status for.\n * @returns The current ID proof status.\n */\nexport type RampsControllerTransakGetIdProofStatusAction = {\n type: `RampsController:transakGetIdProofStatus`;\n handler: RampsController['transakGetIdProofStatus'];\n};\n\n/**\n * Cancels a specific Transak order.\n *\n * @param depositOrderId - The deposit order ID to cancel.\n * @returns A promise that resolves when the order is cancelled.\n */\nexport type RampsControllerTransakCancelOrderAction = {\n type: `RampsController:transakCancelOrder`;\n handler: RampsController['transakCancelOrder'];\n};\n\n/**\n * Cancels all active Transak orders. Individual cancellation failures\n * are collected and returned rather than thrown.\n *\n * @returns An array of errors from any failed cancellations (empty if all succeeded).\n */\nexport type RampsControllerTransakCancelAllActiveOrdersAction = {\n type: `RampsController:transakCancelAllActiveOrders`;\n handler: RampsController['transakCancelAllActiveOrders'];\n};\n\n/**\n * Fetches all active Transak orders for the authenticated user.\n *\n * @returns The list of active orders.\n */\nexport type RampsControllerTransakGetActiveOrdersAction = {\n type: `RampsController:transakGetActiveOrders`;\n handler: RampsController['transakGetActiveOrders'];\n};\n\n/**\n * Union of all RampsController action types.\n */\nexport type RampsControllerMethodActions =\n | RampsControllerExecuteRequestAction\n | RampsControllerAbortRequestAction\n | RampsControllerGetRequestStateAction\n | RampsControllerSetUserRegionAction\n | RampsControllerSetSelectedProviderAction\n | RampsControllerInitAction\n | RampsControllerGetCountriesAction\n | RampsControllerGetTokensAction\n | RampsControllerSetSelectedTokenAction\n | RampsControllerGetProvidersAction\n | RampsControllerGetPaymentMethodsAction\n | RampsControllerSetSelectedPaymentMethodAction\n | RampsControllerGetQuotesAction\n | RampsControllerAddOrderAction\n | RampsControllerRemoveOrderAction\n | RampsControllerStartOrderPollingAction\n | RampsControllerStopOrderPollingAction\n | RampsControllerGetBuyWidgetDataAction\n | RampsControllerAddPrecreatedOrderAction\n | RampsControllerGetOrderAction\n | RampsControllerGetOrderFromCallbackAction\n | RampsControllerTransakSetApiKeyAction\n | RampsControllerTransakSetAccessTokenAction\n | RampsControllerTransakClearAccessTokenAction\n | RampsControllerTransakSetAuthenticatedAction\n | RampsControllerTransakResetStateAction\n | RampsControllerTransakSendUserOtpAction\n | RampsControllerTransakVerifyUserOtpAction\n | RampsControllerTransakLogoutAction\n | RampsControllerTransakGetUserDetailsAction\n | RampsControllerTransakGetBuyQuoteAction\n | RampsControllerTransakGetKycRequirementAction\n | RampsControllerTransakGetAdditionalRequirementsAction\n | RampsControllerTransakCreateOrderAction\n | RampsControllerTransakGetOrderAction\n | RampsControllerTransakGetUserLimitsAction\n | RampsControllerTransakRequestOttAction\n | RampsControllerTransakGeneratePaymentWidgetUrlAction\n | RampsControllerTransakCreateWidgetUrlAction\n | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}
1
+ {"version":3,"file":"RampsController-method-action-types.cjs","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController.js';\n\n/**\n * Executes a request with caching, deduplication, and at most one in-flight\n * request per resource type.\n *\n * 1. **Same cache key in flight** – If a request with this cache key is\n * already pending, returns that promise (deduplication; no second request).\n *\n * 2. **Cache hit** – If valid, non-expired data exists in state.requests for\n * this key and forceRefresh is not set, returns that data without fetching.\n *\n * 3. **New request** – Creates an AbortController and fires the fetcher.\n * If options.resourceType is set, tags the pending request with that\n * resource type (so #abortDependentRequests can cancel it on region\n * change or cleanup) and ref-counts resource-level loading state.\n * On success or error, updates request state and resource error;\n * in finally, clears resource loading only if this request was not\n * aborted.\n *\n * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).\n * @param fetcher - Async function that performs the fetch. Receives an AbortSignal\n * that is aborted when this request is superseded by another for the same resource.\n * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.\n * @returns The result of the request (from cache, joined promise, or fetcher).\n */\nexport type RampsControllerExecuteRequestAction = {\n type: `RampsController:executeRequest`;\n handler: RampsController['executeRequest'];\n};\n\n/**\n * Aborts a pending request if one exists.\n *\n * @param cacheKey - The cache key of the request to abort.\n * @returns True if a request was aborted.\n */\nexport type RampsControllerAbortRequestAction = {\n type: `RampsController:abortRequest`;\n handler: RampsController['abortRequest'];\n};\n\n/**\n * Gets the state of a specific cached request.\n *\n * @param cacheKey - The cache key to look up.\n * @returns The request state, or undefined if not cached.\n */\nexport type RampsControllerGetRequestStateAction = {\n type: `RampsController:getRequestState`;\n handler: RampsController['getRequestState'];\n};\n\n/**\n * Sets the user's region manually (without fetching geolocation).\n * This allows users to override the detected region.\n *\n * @param region - The region code to set (e.g., \"US-CA\").\n * @param options - Options for cache behavior.\n * @returns The user region object.\n */\nexport type RampsControllerSetUserRegionAction = {\n type: `RampsController:setUserRegion`;\n handler: RampsController['setUserRegion'];\n};\n\n/**\n * Sets the user's selected provider.\n *\n * Accepts either a Provider object (stored directly) or a provider ID\n * string (looked up from state). The object form is preferred when the\n * caller already has the full data (e.g. from React Query cache).\n *\n * @param providerOrId - A Provider object, a provider ID string (e.g., \"/providers/moonpay\"), or null to clear.\n * @param options - Optional settings for the selection.\n * @param options.autoSelected - When true, marks the provider as system-guessed\n * (soft selection). The UI will silently auto-switch on token conflict instead\n * of showing the \"Token Not Available\" modal. Defaults to false.\n */\nexport type RampsControllerSetSelectedProviderAction = {\n type: `RampsController:setSelectedProvider`;\n handler: RampsController['setSelectedProvider'];\n};\n\n/**\n * Switches to the first provider in state that serves the given asset,\n * when the currently selected provider does not.\n *\n * This is the controller-level equivalent of UB2's BuildQuote tier-1\n * silent-switch effect and MMPay's `useEnsureCompatibleProvider` hook: it\n * keeps provider-asset compatibility logic in one place rather than\n * duplicating `providerServesAsset` + find-and-switch across multiple UI\n * layers.\n *\n * The compatibility check prefers the current provider's entry in\n * `providers.data` over the `providers.selected` copy, which can be stale\n * once a fresh providers list arrives.\n *\n * No-op when:\n * - `providers.data` is empty (providers not yet loaded)\n * - the currently selected provider already serves the asset\n * - no provider in the list serves the asset (no safe fallback)\n *\n * @param assetId - CAIP-19 asset id of the deposit asset.\n * @param options - Optional settings forwarded to `setSelectedProvider`.\n * @param options.autoSelected - When true, marks the new selection as\n * system-guessed (soft selection). Defaults to true.\n * @returns `true` if the selected provider was changed, `false` otherwise.\n */\nexport type RampsControllerSetSelectedProviderForAssetAction = {\n type: `RampsController:setSelectedProviderForAsset`;\n handler: RampsController['setSelectedProviderForAsset'];\n};\n\n/**\n * Initializes the controller by fetching the user's region from geolocation.\n * This should be called once at app startup to set up the initial region.\n *\n * Idempotent: subsequent calls return the same promise unless forceRefresh is set.\n * Force-refetches the countries catalog on startup (bypassing the in-session\n * request cache) so region preset amounts stay current. The catalog is not\n * persisted, so a cold start always re-fetches it regardless. Skips\n * geolocation when userRegion already exists.\n *\n * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.\n * @returns Promise that resolves when initialization is complete.\n */\nexport type RampsControllerInitAction = {\n type: `RampsController:init`;\n handler: RampsController['init'];\n};\n\n/**\n * Fetches the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * The countries are saved in the controller state once fetched.\n *\n * @param options - Options for cache behavior.\n * @returns An array of countries.\n */\nexport type RampsControllerGetCountriesAction = {\n type: `RampsController:getCountries`;\n handler: RampsController['getCountries'];\n};\n\n/**\n * Fetches the list of available tokens for a given region and action.\n * The tokens are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\nexport type RampsControllerGetTokensAction = {\n type: `RampsController:getTokens`;\n handler: RampsController['getTokens'];\n};\n\n/**\n * Sets the user's selected token by asset ID.\n * Looks up the token from the current tokens in state and automatically\n * fetches payment methods for that token.\n *\n * @param assetId - The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\"), or undefined to clear.\n * @throws If region is not set, tokens are not loaded, or token is not found.\n */\nexport type RampsControllerSetSelectedTokenAction = {\n type: `RampsController:setSelectedToken`;\n handler: RampsController['setSelectedToken'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * The providers are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @param options.crypto - Crypto currency ID(s) to filter by.\n * @param options.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsControllerGetProvidersAction = {\n type: `RampsController:getProviders`;\n handler: RampsController['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given context.\n * The payment methods are saved in the controller state once fetched.\n *\n * @param region - User's region code (e.g. \"fr\", \"us-ny\").\n * @param options - Query parameters for filtering payment methods.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsControllerGetPaymentMethodsAction = {\n type: `RampsController:getPaymentMethods`;\n handler: RampsController['getPaymentMethods'];\n};\n\n/**\n * Sets the user's selected payment method.\n *\n * Accepts either a payment method ID (looked up from state) or a full\n * PaymentMethod object (stored directly). The object form is preferred\n * when the caller already has the full data (e.g. from React Query cache),\n * as it avoids depending on controller state being populated.\n *\n * @param paymentMethodOrId - A PaymentMethod object, a payment method ID string, or undefined/null to clear.\n */\nexport type RampsControllerSetSelectedPaymentMethodAction = {\n type: `RampsController:setSelectedPaymentMethod`;\n handler: RampsController['setSelectedPaymentMethod'];\n};\n\n/**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the controller's request cache; callers manage the response in local state.\n *\n * @param options - The parameters for fetching quotes.\n * @param options.region - User's region code. If not provided, uses userRegion from state.\n * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.amount - The amount (in fiat for buy, crypto for sell).\n * @param options.walletAddress - The destination wallet address.\n * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.\n * @param options.providers - Optional provider IDs to filter quotes.\n * @param options.autoSelectProvider - When true and `providers` is omitted,\n * resolves a provider that supports `assetId` for this request only (no\n * state mutation). Ignored when `providers` is passed.\n * @param options.preferredProviderIds - Optional provider IDs to prefer\n * during auto-selection, in priority order (e.g. derived by the caller\n * from completed-order history). Only used when `autoSelectProvider` is\n * true and `providers` is omitted.\n * @param options.restrictToKnownOrNativeProviders - Headless-buy v0 gating. When\n * true, auto-selection resolves only a native provider, and an explicitly\n * passed `providers` list is filtered to those supporting the region and\n * asset. If nothing qualifies, `getQuotes` returns an empty response\n * instead of quoting other providers.\n * @param options.redirectUrl - Optional redirect URL after order completion.\n * @param options.action - The ramp action type. Defaults to 'buy'.\n * @param options.forceRefresh - Whether to bypass cache.\n * @param options.ttl - Custom TTL for this request.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\nexport type RampsControllerGetQuotesAction = {\n type: `RampsController:getQuotes`;\n handler: RampsController['getQuotes'];\n};\n\n/**\n * Adds or updates a V2 order in controller state.\n * If an order with the same internal order code already exists, the incoming\n * fields are merged on top of the existing order so that fields not present\n * in the update (e.g. paymentDetails from the Transak API) are preserved.\n *\n * @param order - The RampsOrder to add or update.\n */\nexport type RampsControllerAddOrderAction = {\n type: `RampsController:addOrder`;\n handler: RampsController['addOrder'];\n};\n\n/**\n * Removes a V2 order from controller state by providerOrderId.\n *\n * @param providerOrderId - The provider order ID to remove.\n */\nexport type RampsControllerRemoveOrderAction = {\n type: `RampsController:removeOrder`;\n handler: RampsController['removeOrder'];\n};\n\n/**\n * Starts polling all pending V2 orders at a fixed interval.\n * Each poll cycle iterates orders with non-terminal statuses,\n * respects pollingSecondsMinimum and backoff from error count.\n */\nexport type RampsControllerStartOrderPollingAction = {\n type: `RampsController:startOrderPolling`;\n handler: RampsController['startOrderPolling'];\n};\n\n/**\n * Stops order polling and clears the interval.\n */\nexport type RampsControllerStopOrderPollingAction = {\n type: `RampsController:stopOrderPolling`;\n handler: RampsController['stopOrderPolling'];\n};\n\n/**\n * Fetches the widget data from a quote for redirect providers.\n * Makes a request to the buyURL endpoint via the RampsService to get the\n * actual provider widget URL and optional order ID for polling.\n *\n * @param quote - The quote to fetch the widget URL from.\n * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).\n * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.\n */\nexport type RampsControllerGetBuyWidgetDataAction = {\n type: `RampsController:getBuyWidgetData`;\n handler: RampsController['getBuyWidgetData'];\n};\n\n/**\n * Registers an order ID for polling until the order is created or resolved.\n * Adds a minimal stub order to controller state; the existing order polling\n * will fetch the full order when the provider has created it.\n *\n * @param params - Object containing order identifiers and wallet info.\n * @param params.orderId - Full order ID (e.g. \"/providers/paypal/orders/abc123\") or order code.\n * @param params.providerCode - Canonical provider code (e.g. \"paypal\", \"transak\").\n * @param params.walletAddress - Wallet address for the order.\n * @param params.chainId - Optional chain ID for the order.\n */\nexport type RampsControllerAddPrecreatedOrderAction = {\n type: `RampsController:addPrecreatedOrder`;\n handler: RampsController['addPrecreatedOrder'];\n};\n\n/**\n * Fetches an order from the unified V2 API endpoint.\n * Returns a normalized RampsOrder for all provider types (aggregator and native).\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"transak-native\", \"moonpay\").\n * @param orderCode - The order identifier.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderAction = {\n type: `RampsController:getOrder`;\n handler: RampsController['getOrder'];\n};\n\n/**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 backend for provider-specific parsing,\n * then fetches the full order. This is the V2 equivalent of the aggregator\n * SDK's `getOrderFromCallback`.\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"moonpay\").\n * @param callbackUrl - The full callback URL the provider redirected to.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderFromCallbackAction = {\n type: `RampsController:getOrderFromCallback`;\n handler: RampsController['getOrderFromCallback'];\n};\n\n/**\n * Sets the Transak API key used for all Transak API requests.\n *\n * @param apiKey - The Transak API key.\n */\nexport type RampsControllerTransakSetApiKeyAction = {\n type: `RampsController:transakSetApiKey`;\n handler: RampsController['transakSetApiKey'];\n};\n\n/**\n * Sets the Transak access token and marks the user as authenticated.\n *\n * @param token - The access token received from Transak auth.\n */\nexport type RampsControllerTransakSetAccessTokenAction = {\n type: `RampsController:transakSetAccessToken`;\n handler: RampsController['transakSetAccessToken'];\n};\n\n/**\n * Clears the Transak access token and marks the user as unauthenticated.\n */\nexport type RampsControllerTransakClearAccessTokenAction = {\n type: `RampsController:transakClearAccessToken`;\n handler: RampsController['transakClearAccessToken'];\n};\n\n/**\n * Updates the Transak authentication flag in controller state.\n *\n * @param isAuthenticated - Whether the user is authenticated with Transak.\n */\nexport type RampsControllerTransakSetAuthenticatedAction = {\n type: `RampsController:transakSetAuthenticated`;\n handler: RampsController['transakSetAuthenticated'];\n};\n\n/**\n * Resets all Transak state back to defaults (unauthenticated, no data).\n */\nexport type RampsControllerTransakResetStateAction = {\n type: `RampsController:transakResetState`;\n handler: RampsController['transakResetState'];\n};\n\n/**\n * Sends a one-time password to the user's email for Transak authentication.\n *\n * @param email - The user's email address.\n * @returns The OTP response containing a state token for verification.\n */\nexport type RampsControllerTransakSendUserOtpAction = {\n type: `RampsController:transakSendUserOtp`;\n handler: RampsController['transakSendUserOtp'];\n};\n\n/**\n * Verifies a one-time password and authenticates the user with Transak.\n * Updates the controller's authentication state on success.\n *\n * @param email - The user's email address.\n * @param verificationCode - The OTP code entered by the user.\n * @param stateToken - The state token from the sendUserOtp response.\n * @returns The access token for subsequent authenticated requests.\n */\nexport type RampsControllerTransakVerifyUserOtpAction = {\n type: `RampsController:transakVerifyUserOtp`;\n handler: RampsController['transakVerifyUserOtp'];\n};\n\n/**\n * Logs the user out of Transak. Clears authentication state and user details\n * regardless of whether the API call succeeds or fails.\n *\n * @returns A message indicating the logout result.\n */\nexport type RampsControllerTransakLogoutAction = {\n type: `RampsController:transakLogout`;\n handler: RampsController['transakLogout'];\n};\n\n/**\n * Fetches the authenticated user's details from Transak.\n * Updates the userDetails resource state with loading/success/error states.\n *\n * @returns The user's profile and KYC details.\n */\nexport type RampsControllerTransakGetUserDetailsAction = {\n type: `RampsController:transakGetUserDetails`;\n handler: RampsController['transakGetUserDetails'];\n};\n\n/**\n * Fetches a buy quote from Transak for the given parameters.\n * Updates the buyQuote resource state with loading/success/error states.\n *\n * @param fiatCurrency - The fiat currency code (e.g., \"USD\").\n * @param cryptoCurrency - The cryptocurrency identifier.\n * @param network - The blockchain network identifier.\n * @param paymentMethod - The payment method identifier.\n * @param fiatAmount - The fiat amount as a string.\n * @returns The buy quote with pricing and fee details.\n */\nexport type RampsControllerTransakGetBuyQuoteAction = {\n type: `RampsController:transakGetBuyQuote`;\n handler: RampsController['transakGetBuyQuote'];\n};\n\n/**\n * Fetches the KYC requirement for a given quote.\n * Updates the kycRequirement resource state with loading/success/error states.\n *\n * @param quoteId - The quote ID to check KYC requirements for.\n * @returns The KYC requirement status and whether the user can place an order.\n */\nexport type RampsControllerTransakGetKycRequirementAction = {\n type: `RampsController:transakGetKycRequirement`;\n handler: RampsController['transakGetKycRequirement'];\n};\n\n/**\n * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.\n *\n * @param quoteId - The quote ID to check additional requirements for.\n * @returns The list of additional forms required.\n */\nexport type RampsControllerTransakGetAdditionalRequirementsAction = {\n type: `RampsController:transakGetAdditionalRequirements`;\n handler: RampsController['transakGetAdditionalRequirements'];\n};\n\n/**\n * Creates a new order on Transak. If an existing order conflicts (HTTP 409),\n * active orders are cancelled and the creation is retried.\n *\n * @param quoteId - The quote ID to create an order from.\n * @param walletAddress - The destination wallet address.\n * @param paymentMethodId - The payment method to use.\n * @returns The created deposit order.\n */\nexport type RampsControllerTransakCreateOrderAction = {\n type: `RampsController:transakCreateOrder`;\n handler: RampsController['transakCreateOrder'];\n};\n\n/**\n * Fetches an existing order from Transak by order ID.\n *\n * @param orderId - The order ID (deposit format or raw Transak format).\n * @param wallet - The wallet address associated with the order.\n * @param paymentDetails - Optional payment details to attach to the order.\n * @returns The deposit order details.\n */\nexport type RampsControllerTransakGetOrderAction = {\n type: `RampsController:transakGetOrder`;\n handler: RampsController['transakGetOrder'];\n};\n\n/**\n * Fetches the user's spending limits for a given currency and payment method.\n *\n * @param fiatCurrency - The fiat currency code.\n * @param paymentMethod - The payment method identifier.\n * @param kycType - The KYC level type.\n * @returns The user's limits, spending, and remaining amounts.\n */\nexport type RampsControllerTransakGetUserLimitsAction = {\n type: `RampsController:transakGetUserLimits`;\n handler: RampsController['transakGetUserLimits'];\n};\n\n/**\n * Requests a one-time token (OTT) for the Transak payment widget.\n *\n * @returns The OTT response containing the token.\n */\nexport type RampsControllerTransakRequestOttAction = {\n type: `RampsController:transakRequestOtt`;\n handler: RampsController['transakRequestOtt'];\n};\n\n/**\n * Generates a URL for the Transak payment widget with pre-filled parameters.\n *\n * @param ottToken - The one-time token for widget authentication.\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional URL parameters.\n * @returns The fully constructed widget URL string.\n */\nexport type RampsControllerTransakGeneratePaymentWidgetUrlAction = {\n type: `RampsController:transakGeneratePaymentWidgetUrl`;\n handler: RampsController['transakGeneratePaymentWidgetUrl'];\n};\n\n/**\n * Creates a Transak payment widget URL via the ramps API proxy, which\n * injects the partner API key server-side. Replaces the OTT flow\n * ({@link transakRequestOtt} + {@link transakGeneratePaymentWidgetUrl}).\n *\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional widget parameters (e.g. theming).\n * @returns The single-use widget URL.\n */\nexport type RampsControllerTransakCreateWidgetUrlAction = {\n type: `RampsController:transakCreateWidgetUrl`;\n handler: RampsController['transakCreateWidgetUrl'];\n};\n\n/**\n * Submits the user's purpose of usage form for KYC compliance.\n *\n * @param purpose - Array of purpose strings selected by the user.\n * @returns A promise that resolves when the form is submitted.\n */\nexport type RampsControllerTransakSubmitPurposeOfUsageFormAction = {\n type: `RampsController:transakSubmitPurposeOfUsageForm`;\n handler: RampsController['transakSubmitPurposeOfUsageForm'];\n};\n\n/**\n * Updates the user's personal or address details on Transak.\n *\n * @param data - The user data fields to update.\n * @returns The API response data.\n */\nexport type RampsControllerTransakPatchUserAction = {\n type: `RampsController:transakPatchUser`;\n handler: RampsController['transakPatchUser'];\n};\n\n/**\n * Submits the user's SSN for identity verification.\n *\n * @param ssn - The Social Security Number.\n * @param quoteId - The quote ID associated with the order requiring SSN.\n * @returns The API response data.\n */\nexport type RampsControllerTransakSubmitSsnDetailsAction = {\n type: `RampsController:transakSubmitSsnDetails`;\n handler: RampsController['transakSubmitSsnDetails'];\n};\n\n/**\n * Confirms payment for an order after the user has completed payment.\n *\n * @param orderId - The order ID to confirm payment for.\n * @param paymentMethodId - The payment method used.\n * @returns Whether the payment confirmation was successful.\n */\nexport type RampsControllerTransakConfirmPaymentAction = {\n type: `RampsController:transakConfirmPayment`;\n handler: RampsController['transakConfirmPayment'];\n};\n\n/**\n * Translates generic ramps identifiers to Transak-specific identifiers.\n *\n * @param request - The translation request with optional identifiers to translate.\n * @returns The translated Transak-specific identifiers.\n */\nexport type RampsControllerTransakGetTranslationAction = {\n type: `RampsController:transakGetTranslation`;\n handler: RampsController['transakGetTranslation'];\n};\n\n/**\n * Checks the status of an ID proof submission for KYC.\n *\n * @param workFlowRunId - The workflow run ID to check status for.\n * @returns The current ID proof status.\n */\nexport type RampsControllerTransakGetIdProofStatusAction = {\n type: `RampsController:transakGetIdProofStatus`;\n handler: RampsController['transakGetIdProofStatus'];\n};\n\n/**\n * Cancels a specific Transak order.\n *\n * @param depositOrderId - The deposit order ID to cancel.\n * @returns A promise that resolves when the order is cancelled.\n */\nexport type RampsControllerTransakCancelOrderAction = {\n type: `RampsController:transakCancelOrder`;\n handler: RampsController['transakCancelOrder'];\n};\n\n/**\n * Cancels all active Transak orders. Individual cancellation failures\n * are collected and returned rather than thrown.\n *\n * @returns An array of errors from any failed cancellations (empty if all succeeded).\n */\nexport type RampsControllerTransakCancelAllActiveOrdersAction = {\n type: `RampsController:transakCancelAllActiveOrders`;\n handler: RampsController['transakCancelAllActiveOrders'];\n};\n\n/**\n * Fetches all active Transak orders for the authenticated user.\n *\n * @returns The list of active orders.\n */\nexport type RampsControllerTransakGetActiveOrdersAction = {\n type: `RampsController:transakGetActiveOrders`;\n handler: RampsController['transakGetActiveOrders'];\n};\n\n/**\n * Union of all RampsController action types.\n */\nexport type RampsControllerMethodActions =\n | RampsControllerExecuteRequestAction\n | RampsControllerAbortRequestAction\n | RampsControllerGetRequestStateAction\n | RampsControllerSetUserRegionAction\n | RampsControllerSetSelectedProviderAction\n | RampsControllerSetSelectedProviderForAssetAction\n | RampsControllerInitAction\n | RampsControllerGetCountriesAction\n | RampsControllerGetTokensAction\n | RampsControllerSetSelectedTokenAction\n | RampsControllerGetProvidersAction\n | RampsControllerGetPaymentMethodsAction\n | RampsControllerSetSelectedPaymentMethodAction\n | RampsControllerGetQuotesAction\n | RampsControllerAddOrderAction\n | RampsControllerRemoveOrderAction\n | RampsControllerStartOrderPollingAction\n | RampsControllerStopOrderPollingAction\n | RampsControllerGetBuyWidgetDataAction\n | RampsControllerAddPrecreatedOrderAction\n | RampsControllerGetOrderAction\n | RampsControllerGetOrderFromCallbackAction\n | RampsControllerTransakSetApiKeyAction\n | RampsControllerTransakSetAccessTokenAction\n | RampsControllerTransakClearAccessTokenAction\n | RampsControllerTransakSetAuthenticatedAction\n | RampsControllerTransakResetStateAction\n | RampsControllerTransakSendUserOtpAction\n | RampsControllerTransakVerifyUserOtpAction\n | RampsControllerTransakLogoutAction\n | RampsControllerTransakGetUserDetailsAction\n | RampsControllerTransakGetBuyQuoteAction\n | RampsControllerTransakGetKycRequirementAction\n | RampsControllerTransakGetAdditionalRequirementsAction\n | RampsControllerTransakCreateOrderAction\n | RampsControllerTransakGetOrderAction\n | RampsControllerTransakGetUserLimitsAction\n | RampsControllerTransakRequestOttAction\n | RampsControllerTransakGeneratePaymentWidgetUrlAction\n | RampsControllerTransakCreateWidgetUrlAction\n | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}
@@ -80,6 +80,35 @@ export type RampsControllerSetSelectedProviderAction = {
80
80
  type: `RampsController:setSelectedProvider`;
81
81
  handler: RampsController['setSelectedProvider'];
82
82
  };
83
+ /**
84
+ * Switches to the first provider in state that serves the given asset,
85
+ * when the currently selected provider does not.
86
+ *
87
+ * This is the controller-level equivalent of UB2's BuildQuote tier-1
88
+ * silent-switch effect and MMPay's `useEnsureCompatibleProvider` hook: it
89
+ * keeps provider-asset compatibility logic in one place rather than
90
+ * duplicating `providerServesAsset` + find-and-switch across multiple UI
91
+ * layers.
92
+ *
93
+ * The compatibility check prefers the current provider's entry in
94
+ * `providers.data` over the `providers.selected` copy, which can be stale
95
+ * once a fresh providers list arrives.
96
+ *
97
+ * No-op when:
98
+ * - `providers.data` is empty (providers not yet loaded)
99
+ * - the currently selected provider already serves the asset
100
+ * - no provider in the list serves the asset (no safe fallback)
101
+ *
102
+ * @param assetId - CAIP-19 asset id of the deposit asset.
103
+ * @param options - Optional settings forwarded to `setSelectedProvider`.
104
+ * @param options.autoSelected - When true, marks the new selection as
105
+ * system-guessed (soft selection). Defaults to true.
106
+ * @returns `true` if the selected provider was changed, `false` otherwise.
107
+ */
108
+ export type RampsControllerSetSelectedProviderForAssetAction = {
109
+ type: `RampsController:setSelectedProviderForAsset`;
110
+ handler: RampsController['setSelectedProviderForAsset'];
111
+ };
83
112
  /**
84
113
  * Initializes the controller by fetching the user's region from geolocation.
85
114
  * This should be called once at app startup to set up the initial region.
@@ -592,5 +621,5 @@ export type RampsControllerTransakGetActiveOrdersAction = {
592
621
  /**
593
622
  * Union of all RampsController action types.
594
623
  */
595
- export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
624
+ export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerSetSelectedProviderForAssetAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
596
625
  //# sourceMappingURL=RampsController-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RampsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA6B;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC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;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,eAAe,CAAC,8BAA8B,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAC;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GACpC,mCAAmC,GACnC,iCAAiC,GACjC,oCAAoC,GACpC,kCAAkC,GAClC,wCAAwC,GACxC,yBAAyB,GACzB,iCAAiC,GACjC,8BAA8B,GAC9B,qCAAqC,GACrC,iCAAiC,GACjC,sCAAsC,GACtC,6CAA6C,GAC7C,8BAA8B,GAC9B,6BAA6B,GAC7B,gCAAgC,GAChC,sCAAsC,GACtC,qCAAqC,GACrC,qCAAqC,GACrC,uCAAuC,GACvC,6BAA6B,GAC7B,yCAAyC,GACzC,qCAAqC,GACrC,0CAA0C,GAC1C,4CAA4C,GAC5C,4CAA4C,GAC5C,sCAAsC,GACtC,uCAAuC,GACvC,yCAAyC,GACzC,kCAAkC,GAClC,0CAA0C,GAC1C,uCAAuC,GACvC,6CAA6C,GAC7C,qDAAqD,GACrD,uCAAuC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,2CAA2C,GAC3C,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
1
+ {"version":3,"file":"RampsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA6B;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuB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C,GAC7C,8BAA8B,GAC9B,6BAA6B,GAC7B,gCAAgC,GAChC,sCAAsC,GACtC,qCAAqC,GACrC,qCAAqC,GACrC,uCAAuC,GACvC,6BAA6B,GAC7B,yCAAyC,GACzC,qCAAqC,GACrC,0CAA0C,GAC1C,4CAA4C,GAC5C,4CAA4C,GAC5C,sCAAsC,GACtC,uCAAuC,GACvC,yCAAyC,GACzC,kCAAkC,GAClC,0CAA0C,GAC1C,uCAAuC,GACvC,6CAA6C,GAC7C,qDAAqD,GACrD,uCAAuC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,2CAA2C,GAC3C,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
@@ -80,6 +80,35 @@ export type RampsControllerSetSelectedProviderAction = {
80
80
  type: `RampsController:setSelectedProvider`;
81
81
  handler: RampsController['setSelectedProvider'];
82
82
  };
83
+ /**
84
+ * Switches to the first provider in state that serves the given asset,
85
+ * when the currently selected provider does not.
86
+ *
87
+ * This is the controller-level equivalent of UB2's BuildQuote tier-1
88
+ * silent-switch effect and MMPay's `useEnsureCompatibleProvider` hook: it
89
+ * keeps provider-asset compatibility logic in one place rather than
90
+ * duplicating `providerServesAsset` + find-and-switch across multiple UI
91
+ * layers.
92
+ *
93
+ * The compatibility check prefers the current provider's entry in
94
+ * `providers.data` over the `providers.selected` copy, which can be stale
95
+ * once a fresh providers list arrives.
96
+ *
97
+ * No-op when:
98
+ * - `providers.data` is empty (providers not yet loaded)
99
+ * - the currently selected provider already serves the asset
100
+ * - no provider in the list serves the asset (no safe fallback)
101
+ *
102
+ * @param assetId - CAIP-19 asset id of the deposit asset.
103
+ * @param options - Optional settings forwarded to `setSelectedProvider`.
104
+ * @param options.autoSelected - When true, marks the new selection as
105
+ * system-guessed (soft selection). Defaults to true.
106
+ * @returns `true` if the selected provider was changed, `false` otherwise.
107
+ */
108
+ export type RampsControllerSetSelectedProviderForAssetAction = {
109
+ type: `RampsController:setSelectedProviderForAsset`;
110
+ handler: RampsController['setSelectedProviderForAsset'];
111
+ };
83
112
  /**
84
113
  * Initializes the controller by fetching the user's region from geolocation.
85
114
  * This should be called once at app startup to set up the initial region.
@@ -592,5 +621,5 @@ export type RampsControllerTransakGetActiveOrdersAction = {
592
621
  /**
593
622
  * Union of all RampsController action types.
594
623
  */
595
- export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
624
+ export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerSetSelectedProviderForAssetAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
596
625
  //# sourceMappingURL=RampsController-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RampsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA6B;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,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C,kCAAkC,GAClC,wCAAwC,GACxC,yBAAyB,GACzB,iCAAiC,GACjC,8BAA8B,GAC9B,qCAAqC,GACrC,iCAAiC,GACjC,sCAAsC,GACtC,6CAA6C,GAC7C,8BAA8B,GAC9B,6BAA6B,GAC7B,gCAAgC,GAChC,sCAAsC,GACtC,qCAAqC,GACrC,qCAAqC,GACrC,uCAAuC,GACvC,6BAA6B,GAC7B,yCAAyC,GACzC,qCAAqC,GACrC,0CAA0C,GAC1C,4CAA4C,GAC5C,4CAA4C,GAC5C,sCAAsC,GACtC,uCAAuC,GACvC,yCAAyC,GACzC,kCAAkC,GAClC,0CAA0C,GAC1C,uCAAuC,GACvC,6CAA6C,GAC7C,qDAAqD,GACrD,uCAAuC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,2CAA2C,GAC3C,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
1
+ {"version":3,"file":"RampsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA6B;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAA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ACtC,oDAAoD,GACpD,2CAA2C,GAC3C,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RampsController-method-action-types.mjs","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController.js';\n\n/**\n * Executes a request with caching, deduplication, and at most one in-flight\n * request per resource type.\n *\n * 1. **Same cache key in flight** – If a request with this cache key is\n * already pending, returns that promise (deduplication; no second request).\n *\n * 2. **Cache hit** – If valid, non-expired data exists in state.requests for\n * this key and forceRefresh is not set, returns that data without fetching.\n *\n * 3. **New request** – Creates an AbortController and fires the fetcher.\n * If options.resourceType is set, tags the pending request with that\n * resource type (so #abortDependentRequests can cancel it on region\n * change or cleanup) and ref-counts resource-level loading state.\n * On success or error, updates request state and resource error;\n * in finally, clears resource loading only if this request was not\n * aborted.\n *\n * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).\n * @param fetcher - Async function that performs the fetch. Receives an AbortSignal\n * that is aborted when this request is superseded by another for the same resource.\n * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.\n * @returns The result of the request (from cache, joined promise, or fetcher).\n */\nexport type RampsControllerExecuteRequestAction = {\n type: `RampsController:executeRequest`;\n handler: RampsController['executeRequest'];\n};\n\n/**\n * Aborts a pending request if one exists.\n *\n * @param cacheKey - The cache key of the request to abort.\n * @returns True if a request was aborted.\n */\nexport type RampsControllerAbortRequestAction = {\n type: `RampsController:abortRequest`;\n handler: RampsController['abortRequest'];\n};\n\n/**\n * Gets the state of a specific cached request.\n *\n * @param cacheKey - The cache key to look up.\n * @returns The request state, or undefined if not cached.\n */\nexport type RampsControllerGetRequestStateAction = {\n type: `RampsController:getRequestState`;\n handler: RampsController['getRequestState'];\n};\n\n/**\n * Sets the user's region manually (without fetching geolocation).\n * This allows users to override the detected region.\n *\n * @param region - The region code to set (e.g., \"US-CA\").\n * @param options - Options for cache behavior.\n * @returns The user region object.\n */\nexport type RampsControllerSetUserRegionAction = {\n type: `RampsController:setUserRegion`;\n handler: RampsController['setUserRegion'];\n};\n\n/**\n * Sets the user's selected provider.\n *\n * Accepts either a Provider object (stored directly) or a provider ID\n * string (looked up from state). The object form is preferred when the\n * caller already has the full data (e.g. from React Query cache).\n *\n * @param providerOrId - A Provider object, a provider ID string (e.g., \"/providers/moonpay\"), or null to clear.\n * @param options - Optional settings for the selection.\n * @param options.autoSelected - When true, marks the provider as system-guessed\n * (soft selection). The UI will silently auto-switch on token conflict instead\n * of showing the \"Token Not Available\" modal. Defaults to false.\n */\nexport type RampsControllerSetSelectedProviderAction = {\n type: `RampsController:setSelectedProvider`;\n handler: RampsController['setSelectedProvider'];\n};\n\n/**\n * Initializes the controller by fetching the user's region from geolocation.\n * This should be called once at app startup to set up the initial region.\n *\n * Idempotent: subsequent calls return the same promise unless forceRefresh is set.\n * Force-refetches the countries catalog on startup (bypassing the in-session\n * request cache) so region preset amounts stay current. The catalog is not\n * persisted, so a cold start always re-fetches it regardless. Skips\n * geolocation when userRegion already exists.\n *\n * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.\n * @returns Promise that resolves when initialization is complete.\n */\nexport type RampsControllerInitAction = {\n type: `RampsController:init`;\n handler: RampsController['init'];\n};\n\n/**\n * Fetches the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * The countries are saved in the controller state once fetched.\n *\n * @param options - Options for cache behavior.\n * @returns An array of countries.\n */\nexport type RampsControllerGetCountriesAction = {\n type: `RampsController:getCountries`;\n handler: RampsController['getCountries'];\n};\n\n/**\n * Fetches the list of available tokens for a given region and action.\n * The tokens are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\nexport type RampsControllerGetTokensAction = {\n type: `RampsController:getTokens`;\n handler: RampsController['getTokens'];\n};\n\n/**\n * Sets the user's selected token by asset ID.\n * Looks up the token from the current tokens in state and automatically\n * fetches payment methods for that token.\n *\n * @param assetId - The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\"), or undefined to clear.\n * @throws If region is not set, tokens are not loaded, or token is not found.\n */\nexport type RampsControllerSetSelectedTokenAction = {\n type: `RampsController:setSelectedToken`;\n handler: RampsController['setSelectedToken'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * The providers are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @param options.crypto - Crypto currency ID(s) to filter by.\n * @param options.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsControllerGetProvidersAction = {\n type: `RampsController:getProviders`;\n handler: RampsController['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given context.\n * The payment methods are saved in the controller state once fetched.\n *\n * @param region - User's region code (e.g. \"fr\", \"us-ny\").\n * @param options - Query parameters for filtering payment methods.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsControllerGetPaymentMethodsAction = {\n type: `RampsController:getPaymentMethods`;\n handler: RampsController['getPaymentMethods'];\n};\n\n/**\n * Sets the user's selected payment method.\n *\n * Accepts either a payment method ID (looked up from state) or a full\n * PaymentMethod object (stored directly). The object form is preferred\n * when the caller already has the full data (e.g. from React Query cache),\n * as it avoids depending on controller state being populated.\n *\n * @param paymentMethodOrId - A PaymentMethod object, a payment method ID string, or undefined/null to clear.\n */\nexport type RampsControllerSetSelectedPaymentMethodAction = {\n type: `RampsController:setSelectedPaymentMethod`;\n handler: RampsController['setSelectedPaymentMethod'];\n};\n\n/**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the controller's request cache; callers manage the response in local state.\n *\n * @param options - The parameters for fetching quotes.\n * @param options.region - User's region code. If not provided, uses userRegion from state.\n * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.amount - The amount (in fiat for buy, crypto for sell).\n * @param options.walletAddress - The destination wallet address.\n * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.\n * @param options.providers - Optional provider IDs to filter quotes.\n * @param options.autoSelectProvider - When true and `providers` is omitted,\n * resolves a provider that supports `assetId` for this request only (no\n * state mutation). Ignored when `providers` is passed.\n * @param options.preferredProviderIds - Optional provider IDs to prefer\n * during auto-selection, in priority order (e.g. derived by the caller\n * from completed-order history). Only used when `autoSelectProvider` is\n * true and `providers` is omitted.\n * @param options.restrictToKnownOrNativeProviders - Headless-buy v0 gating. When\n * true, auto-selection resolves only a native provider, and an explicitly\n * passed `providers` list is filtered to those supporting the region and\n * asset. If nothing qualifies, `getQuotes` returns an empty response\n * instead of quoting other providers.\n * @param options.redirectUrl - Optional redirect URL after order completion.\n * @param options.action - The ramp action type. Defaults to 'buy'.\n * @param options.forceRefresh - Whether to bypass cache.\n * @param options.ttl - Custom TTL for this request.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\nexport type RampsControllerGetQuotesAction = {\n type: `RampsController:getQuotes`;\n handler: RampsController['getQuotes'];\n};\n\n/**\n * Adds or updates a V2 order in controller state.\n * If an order with the same internal order code already exists, the incoming\n * fields are merged on top of the existing order so that fields not present\n * in the update (e.g. paymentDetails from the Transak API) are preserved.\n *\n * @param order - The RampsOrder to add or update.\n */\nexport type RampsControllerAddOrderAction = {\n type: `RampsController:addOrder`;\n handler: RampsController['addOrder'];\n};\n\n/**\n * Removes a V2 order from controller state by providerOrderId.\n *\n * @param providerOrderId - The provider order ID to remove.\n */\nexport type RampsControllerRemoveOrderAction = {\n type: `RampsController:removeOrder`;\n handler: RampsController['removeOrder'];\n};\n\n/**\n * Starts polling all pending V2 orders at a fixed interval.\n * Each poll cycle iterates orders with non-terminal statuses,\n * respects pollingSecondsMinimum and backoff from error count.\n */\nexport type RampsControllerStartOrderPollingAction = {\n type: `RampsController:startOrderPolling`;\n handler: RampsController['startOrderPolling'];\n};\n\n/**\n * Stops order polling and clears the interval.\n */\nexport type RampsControllerStopOrderPollingAction = {\n type: `RampsController:stopOrderPolling`;\n handler: RampsController['stopOrderPolling'];\n};\n\n/**\n * Fetches the widget data from a quote for redirect providers.\n * Makes a request to the buyURL endpoint via the RampsService to get the\n * actual provider widget URL and optional order ID for polling.\n *\n * @param quote - The quote to fetch the widget URL from.\n * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).\n * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.\n */\nexport type RampsControllerGetBuyWidgetDataAction = {\n type: `RampsController:getBuyWidgetData`;\n handler: RampsController['getBuyWidgetData'];\n};\n\n/**\n * Registers an order ID for polling until the order is created or resolved.\n * Adds a minimal stub order to controller state; the existing order polling\n * will fetch the full order when the provider has created it.\n *\n * @param params - Object containing order identifiers and wallet info.\n * @param params.orderId - Full order ID (e.g. \"/providers/paypal/orders/abc123\") or order code.\n * @param params.providerCode - Canonical provider code (e.g. \"paypal\", \"transak\").\n * @param params.walletAddress - Wallet address for the order.\n * @param params.chainId - Optional chain ID for the order.\n */\nexport type RampsControllerAddPrecreatedOrderAction = {\n type: `RampsController:addPrecreatedOrder`;\n handler: RampsController['addPrecreatedOrder'];\n};\n\n/**\n * Fetches an order from the unified V2 API endpoint.\n * Returns a normalized RampsOrder for all provider types (aggregator and native).\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"transak-native\", \"moonpay\").\n * @param orderCode - The order identifier.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderAction = {\n type: `RampsController:getOrder`;\n handler: RampsController['getOrder'];\n};\n\n/**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 backend for provider-specific parsing,\n * then fetches the full order. This is the V2 equivalent of the aggregator\n * SDK's `getOrderFromCallback`.\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"moonpay\").\n * @param callbackUrl - The full callback URL the provider redirected to.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderFromCallbackAction = {\n type: `RampsController:getOrderFromCallback`;\n handler: RampsController['getOrderFromCallback'];\n};\n\n/**\n * Sets the Transak API key used for all Transak API requests.\n *\n * @param apiKey - The Transak API key.\n */\nexport type RampsControllerTransakSetApiKeyAction = {\n type: `RampsController:transakSetApiKey`;\n handler: RampsController['transakSetApiKey'];\n};\n\n/**\n * Sets the Transak access token and marks the user as authenticated.\n *\n * @param token - The access token received from Transak auth.\n */\nexport type RampsControllerTransakSetAccessTokenAction = {\n type: `RampsController:transakSetAccessToken`;\n handler: RampsController['transakSetAccessToken'];\n};\n\n/**\n * Clears the Transak access token and marks the user as unauthenticated.\n */\nexport type RampsControllerTransakClearAccessTokenAction = {\n type: `RampsController:transakClearAccessToken`;\n handler: RampsController['transakClearAccessToken'];\n};\n\n/**\n * Updates the Transak authentication flag in controller state.\n *\n * @param isAuthenticated - Whether the user is authenticated with Transak.\n */\nexport type RampsControllerTransakSetAuthenticatedAction = {\n type: `RampsController:transakSetAuthenticated`;\n handler: RampsController['transakSetAuthenticated'];\n};\n\n/**\n * Resets all Transak state back to defaults (unauthenticated, no data).\n */\nexport type RampsControllerTransakResetStateAction = {\n type: `RampsController:transakResetState`;\n handler: RampsController['transakResetState'];\n};\n\n/**\n * Sends a one-time password to the user's email for Transak authentication.\n *\n * @param email - The user's email address.\n * @returns The OTP response containing a state token for verification.\n */\nexport type RampsControllerTransakSendUserOtpAction = {\n type: `RampsController:transakSendUserOtp`;\n handler: RampsController['transakSendUserOtp'];\n};\n\n/**\n * Verifies a one-time password and authenticates the user with Transak.\n * Updates the controller's authentication state on success.\n *\n * @param email - The user's email address.\n * @param verificationCode - The OTP code entered by the user.\n * @param stateToken - The state token from the sendUserOtp response.\n * @returns The access token for subsequent authenticated requests.\n */\nexport type RampsControllerTransakVerifyUserOtpAction = {\n type: `RampsController:transakVerifyUserOtp`;\n handler: RampsController['transakVerifyUserOtp'];\n};\n\n/**\n * Logs the user out of Transak. Clears authentication state and user details\n * regardless of whether the API call succeeds or fails.\n *\n * @returns A message indicating the logout result.\n */\nexport type RampsControllerTransakLogoutAction = {\n type: `RampsController:transakLogout`;\n handler: RampsController['transakLogout'];\n};\n\n/**\n * Fetches the authenticated user's details from Transak.\n * Updates the userDetails resource state with loading/success/error states.\n *\n * @returns The user's profile and KYC details.\n */\nexport type RampsControllerTransakGetUserDetailsAction = {\n type: `RampsController:transakGetUserDetails`;\n handler: RampsController['transakGetUserDetails'];\n};\n\n/**\n * Fetches a buy quote from Transak for the given parameters.\n * Updates the buyQuote resource state with loading/success/error states.\n *\n * @param fiatCurrency - The fiat currency code (e.g., \"USD\").\n * @param cryptoCurrency - The cryptocurrency identifier.\n * @param network - The blockchain network identifier.\n * @param paymentMethod - The payment method identifier.\n * @param fiatAmount - The fiat amount as a string.\n * @returns The buy quote with pricing and fee details.\n */\nexport type RampsControllerTransakGetBuyQuoteAction = {\n type: `RampsController:transakGetBuyQuote`;\n handler: RampsController['transakGetBuyQuote'];\n};\n\n/**\n * Fetches the KYC requirement for a given quote.\n * Updates the kycRequirement resource state with loading/success/error states.\n *\n * @param quoteId - The quote ID to check KYC requirements for.\n * @returns The KYC requirement status and whether the user can place an order.\n */\nexport type RampsControllerTransakGetKycRequirementAction = {\n type: `RampsController:transakGetKycRequirement`;\n handler: RampsController['transakGetKycRequirement'];\n};\n\n/**\n * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.\n *\n * @param quoteId - The quote ID to check additional requirements for.\n * @returns The list of additional forms required.\n */\nexport type RampsControllerTransakGetAdditionalRequirementsAction = {\n type: `RampsController:transakGetAdditionalRequirements`;\n handler: RampsController['transakGetAdditionalRequirements'];\n};\n\n/**\n * Creates a new order on Transak. If an existing order conflicts (HTTP 409),\n * active orders are cancelled and the creation is retried.\n *\n * @param quoteId - The quote ID to create an order from.\n * @param walletAddress - The destination wallet address.\n * @param paymentMethodId - The payment method to use.\n * @returns The created deposit order.\n */\nexport type RampsControllerTransakCreateOrderAction = {\n type: `RampsController:transakCreateOrder`;\n handler: RampsController['transakCreateOrder'];\n};\n\n/**\n * Fetches an existing order from Transak by order ID.\n *\n * @param orderId - The order ID (deposit format or raw Transak format).\n * @param wallet - The wallet address associated with the order.\n * @param paymentDetails - Optional payment details to attach to the order.\n * @returns The deposit order details.\n */\nexport type RampsControllerTransakGetOrderAction = {\n type: `RampsController:transakGetOrder`;\n handler: RampsController['transakGetOrder'];\n};\n\n/**\n * Fetches the user's spending limits for a given currency and payment method.\n *\n * @param fiatCurrency - The fiat currency code.\n * @param paymentMethod - The payment method identifier.\n * @param kycType - The KYC level type.\n * @returns The user's limits, spending, and remaining amounts.\n */\nexport type RampsControllerTransakGetUserLimitsAction = {\n type: `RampsController:transakGetUserLimits`;\n handler: RampsController['transakGetUserLimits'];\n};\n\n/**\n * Requests a one-time token (OTT) for the Transak payment widget.\n *\n * @returns The OTT response containing the token.\n */\nexport type RampsControllerTransakRequestOttAction = {\n type: `RampsController:transakRequestOtt`;\n handler: RampsController['transakRequestOtt'];\n};\n\n/**\n * Generates a URL for the Transak payment widget with pre-filled parameters.\n *\n * @param ottToken - The one-time token for widget authentication.\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional URL parameters.\n * @returns The fully constructed widget URL string.\n */\nexport type RampsControllerTransakGeneratePaymentWidgetUrlAction = {\n type: `RampsController:transakGeneratePaymentWidgetUrl`;\n handler: RampsController['transakGeneratePaymentWidgetUrl'];\n};\n\n/**\n * Creates a Transak payment widget URL via the ramps API proxy, which\n * injects the partner API key server-side. Replaces the OTT flow\n * ({@link transakRequestOtt} + {@link transakGeneratePaymentWidgetUrl}).\n *\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional widget parameters (e.g. theming).\n * @returns The single-use widget URL.\n */\nexport type RampsControllerTransakCreateWidgetUrlAction = {\n type: `RampsController:transakCreateWidgetUrl`;\n handler: RampsController['transakCreateWidgetUrl'];\n};\n\n/**\n * Submits the user's purpose of usage form for KYC compliance.\n *\n * @param purpose - Array of purpose strings selected by the user.\n * @returns A promise that resolves when the form is submitted.\n */\nexport type RampsControllerTransakSubmitPurposeOfUsageFormAction = {\n type: `RampsController:transakSubmitPurposeOfUsageForm`;\n handler: RampsController['transakSubmitPurposeOfUsageForm'];\n};\n\n/**\n * Updates the user's personal or address details on Transak.\n *\n * @param data - The user data fields to update.\n * @returns The API response data.\n */\nexport type RampsControllerTransakPatchUserAction = {\n type: `RampsController:transakPatchUser`;\n handler: RampsController['transakPatchUser'];\n};\n\n/**\n * Submits the user's SSN for identity verification.\n *\n * @param ssn - The Social Security Number.\n * @param quoteId - The quote ID associated with the order requiring SSN.\n * @returns The API response data.\n */\nexport type RampsControllerTransakSubmitSsnDetailsAction = {\n type: `RampsController:transakSubmitSsnDetails`;\n handler: RampsController['transakSubmitSsnDetails'];\n};\n\n/**\n * Confirms payment for an order after the user has completed payment.\n *\n * @param orderId - The order ID to confirm payment for.\n * @param paymentMethodId - The payment method used.\n * @returns Whether the payment confirmation was successful.\n */\nexport type RampsControllerTransakConfirmPaymentAction = {\n type: `RampsController:transakConfirmPayment`;\n handler: RampsController['transakConfirmPayment'];\n};\n\n/**\n * Translates generic ramps identifiers to Transak-specific identifiers.\n *\n * @param request - The translation request with optional identifiers to translate.\n * @returns The translated Transak-specific identifiers.\n */\nexport type RampsControllerTransakGetTranslationAction = {\n type: `RampsController:transakGetTranslation`;\n handler: RampsController['transakGetTranslation'];\n};\n\n/**\n * Checks the status of an ID proof submission for KYC.\n *\n * @param workFlowRunId - The workflow run ID to check status for.\n * @returns The current ID proof status.\n */\nexport type RampsControllerTransakGetIdProofStatusAction = {\n type: `RampsController:transakGetIdProofStatus`;\n handler: RampsController['transakGetIdProofStatus'];\n};\n\n/**\n * Cancels a specific Transak order.\n *\n * @param depositOrderId - The deposit order ID to cancel.\n * @returns A promise that resolves when the order is cancelled.\n */\nexport type RampsControllerTransakCancelOrderAction = {\n type: `RampsController:transakCancelOrder`;\n handler: RampsController['transakCancelOrder'];\n};\n\n/**\n * Cancels all active Transak orders. Individual cancellation failures\n * are collected and returned rather than thrown.\n *\n * @returns An array of errors from any failed cancellations (empty if all succeeded).\n */\nexport type RampsControllerTransakCancelAllActiveOrdersAction = {\n type: `RampsController:transakCancelAllActiveOrders`;\n handler: RampsController['transakCancelAllActiveOrders'];\n};\n\n/**\n * Fetches all active Transak orders for the authenticated user.\n *\n * @returns The list of active orders.\n */\nexport type RampsControllerTransakGetActiveOrdersAction = {\n type: `RampsController:transakGetActiveOrders`;\n handler: RampsController['transakGetActiveOrders'];\n};\n\n/**\n * Union of all RampsController action types.\n */\nexport type RampsControllerMethodActions =\n | RampsControllerExecuteRequestAction\n | RampsControllerAbortRequestAction\n | RampsControllerGetRequestStateAction\n | RampsControllerSetUserRegionAction\n | RampsControllerSetSelectedProviderAction\n | RampsControllerInitAction\n | RampsControllerGetCountriesAction\n | RampsControllerGetTokensAction\n | RampsControllerSetSelectedTokenAction\n | RampsControllerGetProvidersAction\n | RampsControllerGetPaymentMethodsAction\n | RampsControllerSetSelectedPaymentMethodAction\n | RampsControllerGetQuotesAction\n | RampsControllerAddOrderAction\n | RampsControllerRemoveOrderAction\n | RampsControllerStartOrderPollingAction\n | RampsControllerStopOrderPollingAction\n | RampsControllerGetBuyWidgetDataAction\n | RampsControllerAddPrecreatedOrderAction\n | RampsControllerGetOrderAction\n | RampsControllerGetOrderFromCallbackAction\n | RampsControllerTransakSetApiKeyAction\n | RampsControllerTransakSetAccessTokenAction\n | RampsControllerTransakClearAccessTokenAction\n | RampsControllerTransakSetAuthenticatedAction\n | RampsControllerTransakResetStateAction\n | RampsControllerTransakSendUserOtpAction\n | RampsControllerTransakVerifyUserOtpAction\n | RampsControllerTransakLogoutAction\n | RampsControllerTransakGetUserDetailsAction\n | RampsControllerTransakGetBuyQuoteAction\n | RampsControllerTransakGetKycRequirementAction\n | RampsControllerTransakGetAdditionalRequirementsAction\n | RampsControllerTransakCreateOrderAction\n | RampsControllerTransakGetOrderAction\n | RampsControllerTransakGetUserLimitsAction\n | RampsControllerTransakRequestOttAction\n | RampsControllerTransakGeneratePaymentWidgetUrlAction\n | RampsControllerTransakCreateWidgetUrlAction\n | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}
1
+ {"version":3,"file":"RampsController-method-action-types.mjs","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController.js';\n\n/**\n * Executes a request with caching, deduplication, and at most one in-flight\n * request per resource type.\n *\n * 1. **Same cache key in flight** – If a request with this cache key is\n * already pending, returns that promise (deduplication; no second request).\n *\n * 2. **Cache hit** – If valid, non-expired data exists in state.requests for\n * this key and forceRefresh is not set, returns that data without fetching.\n *\n * 3. **New request** – Creates an AbortController and fires the fetcher.\n * If options.resourceType is set, tags the pending request with that\n * resource type (so #abortDependentRequests can cancel it on region\n * change or cleanup) and ref-counts resource-level loading state.\n * On success or error, updates request state and resource error;\n * in finally, clears resource loading only if this request was not\n * aborted.\n *\n * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).\n * @param fetcher - Async function that performs the fetch. Receives an AbortSignal\n * that is aborted when this request is superseded by another for the same resource.\n * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.\n * @returns The result of the request (from cache, joined promise, or fetcher).\n */\nexport type RampsControllerExecuteRequestAction = {\n type: `RampsController:executeRequest`;\n handler: RampsController['executeRequest'];\n};\n\n/**\n * Aborts a pending request if one exists.\n *\n * @param cacheKey - The cache key of the request to abort.\n * @returns True if a request was aborted.\n */\nexport type RampsControllerAbortRequestAction = {\n type: `RampsController:abortRequest`;\n handler: RampsController['abortRequest'];\n};\n\n/**\n * Gets the state of a specific cached request.\n *\n * @param cacheKey - The cache key to look up.\n * @returns The request state, or undefined if not cached.\n */\nexport type RampsControllerGetRequestStateAction = {\n type: `RampsController:getRequestState`;\n handler: RampsController['getRequestState'];\n};\n\n/**\n * Sets the user's region manually (without fetching geolocation).\n * This allows users to override the detected region.\n *\n * @param region - The region code to set (e.g., \"US-CA\").\n * @param options - Options for cache behavior.\n * @returns The user region object.\n */\nexport type RampsControllerSetUserRegionAction = {\n type: `RampsController:setUserRegion`;\n handler: RampsController['setUserRegion'];\n};\n\n/**\n * Sets the user's selected provider.\n *\n * Accepts either a Provider object (stored directly) or a provider ID\n * string (looked up from state). The object form is preferred when the\n * caller already has the full data (e.g. from React Query cache).\n *\n * @param providerOrId - A Provider object, a provider ID string (e.g., \"/providers/moonpay\"), or null to clear.\n * @param options - Optional settings for the selection.\n * @param options.autoSelected - When true, marks the provider as system-guessed\n * (soft selection). The UI will silently auto-switch on token conflict instead\n * of showing the \"Token Not Available\" modal. Defaults to false.\n */\nexport type RampsControllerSetSelectedProviderAction = {\n type: `RampsController:setSelectedProvider`;\n handler: RampsController['setSelectedProvider'];\n};\n\n/**\n * Switches to the first provider in state that serves the given asset,\n * when the currently selected provider does not.\n *\n * This is the controller-level equivalent of UB2's BuildQuote tier-1\n * silent-switch effect and MMPay's `useEnsureCompatibleProvider` hook: it\n * keeps provider-asset compatibility logic in one place rather than\n * duplicating `providerServesAsset` + find-and-switch across multiple UI\n * layers.\n *\n * The compatibility check prefers the current provider's entry in\n * `providers.data` over the `providers.selected` copy, which can be stale\n * once a fresh providers list arrives.\n *\n * No-op when:\n * - `providers.data` is empty (providers not yet loaded)\n * - the currently selected provider already serves the asset\n * - no provider in the list serves the asset (no safe fallback)\n *\n * @param assetId - CAIP-19 asset id of the deposit asset.\n * @param options - Optional settings forwarded to `setSelectedProvider`.\n * @param options.autoSelected - When true, marks the new selection as\n * system-guessed (soft selection). Defaults to true.\n * @returns `true` if the selected provider was changed, `false` otherwise.\n */\nexport type RampsControllerSetSelectedProviderForAssetAction = {\n type: `RampsController:setSelectedProviderForAsset`;\n handler: RampsController['setSelectedProviderForAsset'];\n};\n\n/**\n * Initializes the controller by fetching the user's region from geolocation.\n * This should be called once at app startup to set up the initial region.\n *\n * Idempotent: subsequent calls return the same promise unless forceRefresh is set.\n * Force-refetches the countries catalog on startup (bypassing the in-session\n * request cache) so region preset amounts stay current. The catalog is not\n * persisted, so a cold start always re-fetches it regardless. Skips\n * geolocation when userRegion already exists.\n *\n * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.\n * @returns Promise that resolves when initialization is complete.\n */\nexport type RampsControllerInitAction = {\n type: `RampsController:init`;\n handler: RampsController['init'];\n};\n\n/**\n * Fetches the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * The countries are saved in the controller state once fetched.\n *\n * @param options - Options for cache behavior.\n * @returns An array of countries.\n */\nexport type RampsControllerGetCountriesAction = {\n type: `RampsController:getCountries`;\n handler: RampsController['getCountries'];\n};\n\n/**\n * Fetches the list of available tokens for a given region and action.\n * The tokens are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\nexport type RampsControllerGetTokensAction = {\n type: `RampsController:getTokens`;\n handler: RampsController['getTokens'];\n};\n\n/**\n * Sets the user's selected token by asset ID.\n * Looks up the token from the current tokens in state and automatically\n * fetches payment methods for that token.\n *\n * @param assetId - The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\"), or undefined to clear.\n * @throws If region is not set, tokens are not loaded, or token is not found.\n */\nexport type RampsControllerSetSelectedTokenAction = {\n type: `RampsController:setSelectedToken`;\n handler: RampsController['setSelectedToken'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * The providers are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @param options.crypto - Crypto currency ID(s) to filter by.\n * @param options.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsControllerGetProvidersAction = {\n type: `RampsController:getProviders`;\n handler: RampsController['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given context.\n * The payment methods are saved in the controller state once fetched.\n *\n * @param region - User's region code (e.g. \"fr\", \"us-ny\").\n * @param options - Query parameters for filtering payment methods.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsControllerGetPaymentMethodsAction = {\n type: `RampsController:getPaymentMethods`;\n handler: RampsController['getPaymentMethods'];\n};\n\n/**\n * Sets the user's selected payment method.\n *\n * Accepts either a payment method ID (looked up from state) or a full\n * PaymentMethod object (stored directly). The object form is preferred\n * when the caller already has the full data (e.g. from React Query cache),\n * as it avoids depending on controller state being populated.\n *\n * @param paymentMethodOrId - A PaymentMethod object, a payment method ID string, or undefined/null to clear.\n */\nexport type RampsControllerSetSelectedPaymentMethodAction = {\n type: `RampsController:setSelectedPaymentMethod`;\n handler: RampsController['setSelectedPaymentMethod'];\n};\n\n/**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the controller's request cache; callers manage the response in local state.\n *\n * @param options - The parameters for fetching quotes.\n * @param options.region - User's region code. If not provided, uses userRegion from state.\n * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.amount - The amount (in fiat for buy, crypto for sell).\n * @param options.walletAddress - The destination wallet address.\n * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.\n * @param options.providers - Optional provider IDs to filter quotes.\n * @param options.autoSelectProvider - When true and `providers` is omitted,\n * resolves a provider that supports `assetId` for this request only (no\n * state mutation). Ignored when `providers` is passed.\n * @param options.preferredProviderIds - Optional provider IDs to prefer\n * during auto-selection, in priority order (e.g. derived by the caller\n * from completed-order history). Only used when `autoSelectProvider` is\n * true and `providers` is omitted.\n * @param options.restrictToKnownOrNativeProviders - Headless-buy v0 gating. When\n * true, auto-selection resolves only a native provider, and an explicitly\n * passed `providers` list is filtered to those supporting the region and\n * asset. If nothing qualifies, `getQuotes` returns an empty response\n * instead of quoting other providers.\n * @param options.redirectUrl - Optional redirect URL after order completion.\n * @param options.action - The ramp action type. Defaults to 'buy'.\n * @param options.forceRefresh - Whether to bypass cache.\n * @param options.ttl - Custom TTL for this request.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\nexport type RampsControllerGetQuotesAction = {\n type: `RampsController:getQuotes`;\n handler: RampsController['getQuotes'];\n};\n\n/**\n * Adds or updates a V2 order in controller state.\n * If an order with the same internal order code already exists, the incoming\n * fields are merged on top of the existing order so that fields not present\n * in the update (e.g. paymentDetails from the Transak API) are preserved.\n *\n * @param order - The RampsOrder to add or update.\n */\nexport type RampsControllerAddOrderAction = {\n type: `RampsController:addOrder`;\n handler: RampsController['addOrder'];\n};\n\n/**\n * Removes a V2 order from controller state by providerOrderId.\n *\n * @param providerOrderId - The provider order ID to remove.\n */\nexport type RampsControllerRemoveOrderAction = {\n type: `RampsController:removeOrder`;\n handler: RampsController['removeOrder'];\n};\n\n/**\n * Starts polling all pending V2 orders at a fixed interval.\n * Each poll cycle iterates orders with non-terminal statuses,\n * respects pollingSecondsMinimum and backoff from error count.\n */\nexport type RampsControllerStartOrderPollingAction = {\n type: `RampsController:startOrderPolling`;\n handler: RampsController['startOrderPolling'];\n};\n\n/**\n * Stops order polling and clears the interval.\n */\nexport type RampsControllerStopOrderPollingAction = {\n type: `RampsController:stopOrderPolling`;\n handler: RampsController['stopOrderPolling'];\n};\n\n/**\n * Fetches the widget data from a quote for redirect providers.\n * Makes a request to the buyURL endpoint via the RampsService to get the\n * actual provider widget URL and optional order ID for polling.\n *\n * @param quote - The quote to fetch the widget URL from.\n * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).\n * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.\n */\nexport type RampsControllerGetBuyWidgetDataAction = {\n type: `RampsController:getBuyWidgetData`;\n handler: RampsController['getBuyWidgetData'];\n};\n\n/**\n * Registers an order ID for polling until the order is created or resolved.\n * Adds a minimal stub order to controller state; the existing order polling\n * will fetch the full order when the provider has created it.\n *\n * @param params - Object containing order identifiers and wallet info.\n * @param params.orderId - Full order ID (e.g. \"/providers/paypal/orders/abc123\") or order code.\n * @param params.providerCode - Canonical provider code (e.g. \"paypal\", \"transak\").\n * @param params.walletAddress - Wallet address for the order.\n * @param params.chainId - Optional chain ID for the order.\n */\nexport type RampsControllerAddPrecreatedOrderAction = {\n type: `RampsController:addPrecreatedOrder`;\n handler: RampsController['addPrecreatedOrder'];\n};\n\n/**\n * Fetches an order from the unified V2 API endpoint.\n * Returns a normalized RampsOrder for all provider types (aggregator and native).\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"transak-native\", \"moonpay\").\n * @param orderCode - The order identifier.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderAction = {\n type: `RampsController:getOrder`;\n handler: RampsController['getOrder'];\n};\n\n/**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 backend for provider-specific parsing,\n * then fetches the full order. This is the V2 equivalent of the aggregator\n * SDK's `getOrderFromCallback`.\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"moonpay\").\n * @param callbackUrl - The full callback URL the provider redirected to.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderFromCallbackAction = {\n type: `RampsController:getOrderFromCallback`;\n handler: RampsController['getOrderFromCallback'];\n};\n\n/**\n * Sets the Transak API key used for all Transak API requests.\n *\n * @param apiKey - The Transak API key.\n */\nexport type RampsControllerTransakSetApiKeyAction = {\n type: `RampsController:transakSetApiKey`;\n handler: RampsController['transakSetApiKey'];\n};\n\n/**\n * Sets the Transak access token and marks the user as authenticated.\n *\n * @param token - The access token received from Transak auth.\n */\nexport type RampsControllerTransakSetAccessTokenAction = {\n type: `RampsController:transakSetAccessToken`;\n handler: RampsController['transakSetAccessToken'];\n};\n\n/**\n * Clears the Transak access token and marks the user as unauthenticated.\n */\nexport type RampsControllerTransakClearAccessTokenAction = {\n type: `RampsController:transakClearAccessToken`;\n handler: RampsController['transakClearAccessToken'];\n};\n\n/**\n * Updates the Transak authentication flag in controller state.\n *\n * @param isAuthenticated - Whether the user is authenticated with Transak.\n */\nexport type RampsControllerTransakSetAuthenticatedAction = {\n type: `RampsController:transakSetAuthenticated`;\n handler: RampsController['transakSetAuthenticated'];\n};\n\n/**\n * Resets all Transak state back to defaults (unauthenticated, no data).\n */\nexport type RampsControllerTransakResetStateAction = {\n type: `RampsController:transakResetState`;\n handler: RampsController['transakResetState'];\n};\n\n/**\n * Sends a one-time password to the user's email for Transak authentication.\n *\n * @param email - The user's email address.\n * @returns The OTP response containing a state token for verification.\n */\nexport type RampsControllerTransakSendUserOtpAction = {\n type: `RampsController:transakSendUserOtp`;\n handler: RampsController['transakSendUserOtp'];\n};\n\n/**\n * Verifies a one-time password and authenticates the user with Transak.\n * Updates the controller's authentication state on success.\n *\n * @param email - The user's email address.\n * @param verificationCode - The OTP code entered by the user.\n * @param stateToken - The state token from the sendUserOtp response.\n * @returns The access token for subsequent authenticated requests.\n */\nexport type RampsControllerTransakVerifyUserOtpAction = {\n type: `RampsController:transakVerifyUserOtp`;\n handler: RampsController['transakVerifyUserOtp'];\n};\n\n/**\n * Logs the user out of Transak. Clears authentication state and user details\n * regardless of whether the API call succeeds or fails.\n *\n * @returns A message indicating the logout result.\n */\nexport type RampsControllerTransakLogoutAction = {\n type: `RampsController:transakLogout`;\n handler: RampsController['transakLogout'];\n};\n\n/**\n * Fetches the authenticated user's details from Transak.\n * Updates the userDetails resource state with loading/success/error states.\n *\n * @returns The user's profile and KYC details.\n */\nexport type RampsControllerTransakGetUserDetailsAction = {\n type: `RampsController:transakGetUserDetails`;\n handler: RampsController['transakGetUserDetails'];\n};\n\n/**\n * Fetches a buy quote from Transak for the given parameters.\n * Updates the buyQuote resource state with loading/success/error states.\n *\n * @param fiatCurrency - The fiat currency code (e.g., \"USD\").\n * @param cryptoCurrency - The cryptocurrency identifier.\n * @param network - The blockchain network identifier.\n * @param paymentMethod - The payment method identifier.\n * @param fiatAmount - The fiat amount as a string.\n * @returns The buy quote with pricing and fee details.\n */\nexport type RampsControllerTransakGetBuyQuoteAction = {\n type: `RampsController:transakGetBuyQuote`;\n handler: RampsController['transakGetBuyQuote'];\n};\n\n/**\n * Fetches the KYC requirement for a given quote.\n * Updates the kycRequirement resource state with loading/success/error states.\n *\n * @param quoteId - The quote ID to check KYC requirements for.\n * @returns The KYC requirement status and whether the user can place an order.\n */\nexport type RampsControllerTransakGetKycRequirementAction = {\n type: `RampsController:transakGetKycRequirement`;\n handler: RampsController['transakGetKycRequirement'];\n};\n\n/**\n * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.\n *\n * @param quoteId - The quote ID to check additional requirements for.\n * @returns The list of additional forms required.\n */\nexport type RampsControllerTransakGetAdditionalRequirementsAction = {\n type: `RampsController:transakGetAdditionalRequirements`;\n handler: RampsController['transakGetAdditionalRequirements'];\n};\n\n/**\n * Creates a new order on Transak. If an existing order conflicts (HTTP 409),\n * active orders are cancelled and the creation is retried.\n *\n * @param quoteId - The quote ID to create an order from.\n * @param walletAddress - The destination wallet address.\n * @param paymentMethodId - The payment method to use.\n * @returns The created deposit order.\n */\nexport type RampsControllerTransakCreateOrderAction = {\n type: `RampsController:transakCreateOrder`;\n handler: RampsController['transakCreateOrder'];\n};\n\n/**\n * Fetches an existing order from Transak by order ID.\n *\n * @param orderId - The order ID (deposit format or raw Transak format).\n * @param wallet - The wallet address associated with the order.\n * @param paymentDetails - Optional payment details to attach to the order.\n * @returns The deposit order details.\n */\nexport type RampsControllerTransakGetOrderAction = {\n type: `RampsController:transakGetOrder`;\n handler: RampsController['transakGetOrder'];\n};\n\n/**\n * Fetches the user's spending limits for a given currency and payment method.\n *\n * @param fiatCurrency - The fiat currency code.\n * @param paymentMethod - The payment method identifier.\n * @param kycType - The KYC level type.\n * @returns The user's limits, spending, and remaining amounts.\n */\nexport type RampsControllerTransakGetUserLimitsAction = {\n type: `RampsController:transakGetUserLimits`;\n handler: RampsController['transakGetUserLimits'];\n};\n\n/**\n * Requests a one-time token (OTT) for the Transak payment widget.\n *\n * @returns The OTT response containing the token.\n */\nexport type RampsControllerTransakRequestOttAction = {\n type: `RampsController:transakRequestOtt`;\n handler: RampsController['transakRequestOtt'];\n};\n\n/**\n * Generates a URL for the Transak payment widget with pre-filled parameters.\n *\n * @param ottToken - The one-time token for widget authentication.\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional URL parameters.\n * @returns The fully constructed widget URL string.\n */\nexport type RampsControllerTransakGeneratePaymentWidgetUrlAction = {\n type: `RampsController:transakGeneratePaymentWidgetUrl`;\n handler: RampsController['transakGeneratePaymentWidgetUrl'];\n};\n\n/**\n * Creates a Transak payment widget URL via the ramps API proxy, which\n * injects the partner API key server-side. Replaces the OTT flow\n * ({@link transakRequestOtt} + {@link transakGeneratePaymentWidgetUrl}).\n *\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional widget parameters (e.g. theming).\n * @returns The single-use widget URL.\n */\nexport type RampsControllerTransakCreateWidgetUrlAction = {\n type: `RampsController:transakCreateWidgetUrl`;\n handler: RampsController['transakCreateWidgetUrl'];\n};\n\n/**\n * Submits the user's purpose of usage form for KYC compliance.\n *\n * @param purpose - Array of purpose strings selected by the user.\n * @returns A promise that resolves when the form is submitted.\n */\nexport type RampsControllerTransakSubmitPurposeOfUsageFormAction = {\n type: `RampsController:transakSubmitPurposeOfUsageForm`;\n handler: RampsController['transakSubmitPurposeOfUsageForm'];\n};\n\n/**\n * Updates the user's personal or address details on Transak.\n *\n * @param data - The user data fields to update.\n * @returns The API response data.\n */\nexport type RampsControllerTransakPatchUserAction = {\n type: `RampsController:transakPatchUser`;\n handler: RampsController['transakPatchUser'];\n};\n\n/**\n * Submits the user's SSN for identity verification.\n *\n * @param ssn - The Social Security Number.\n * @param quoteId - The quote ID associated with the order requiring SSN.\n * @returns The API response data.\n */\nexport type RampsControllerTransakSubmitSsnDetailsAction = {\n type: `RampsController:transakSubmitSsnDetails`;\n handler: RampsController['transakSubmitSsnDetails'];\n};\n\n/**\n * Confirms payment for an order after the user has completed payment.\n *\n * @param orderId - The order ID to confirm payment for.\n * @param paymentMethodId - The payment method used.\n * @returns Whether the payment confirmation was successful.\n */\nexport type RampsControllerTransakConfirmPaymentAction = {\n type: `RampsController:transakConfirmPayment`;\n handler: RampsController['transakConfirmPayment'];\n};\n\n/**\n * Translates generic ramps identifiers to Transak-specific identifiers.\n *\n * @param request - The translation request with optional identifiers to translate.\n * @returns The translated Transak-specific identifiers.\n */\nexport type RampsControllerTransakGetTranslationAction = {\n type: `RampsController:transakGetTranslation`;\n handler: RampsController['transakGetTranslation'];\n};\n\n/**\n * Checks the status of an ID proof submission for KYC.\n *\n * @param workFlowRunId - The workflow run ID to check status for.\n * @returns The current ID proof status.\n */\nexport type RampsControllerTransakGetIdProofStatusAction = {\n type: `RampsController:transakGetIdProofStatus`;\n handler: RampsController['transakGetIdProofStatus'];\n};\n\n/**\n * Cancels a specific Transak order.\n *\n * @param depositOrderId - The deposit order ID to cancel.\n * @returns A promise that resolves when the order is cancelled.\n */\nexport type RampsControllerTransakCancelOrderAction = {\n type: `RampsController:transakCancelOrder`;\n handler: RampsController['transakCancelOrder'];\n};\n\n/**\n * Cancels all active Transak orders. Individual cancellation failures\n * are collected and returned rather than thrown.\n *\n * @returns An array of errors from any failed cancellations (empty if all succeeded).\n */\nexport type RampsControllerTransakCancelAllActiveOrdersAction = {\n type: `RampsController:transakCancelAllActiveOrders`;\n handler: RampsController['transakCancelAllActiveOrders'];\n};\n\n/**\n * Fetches all active Transak orders for the authenticated user.\n *\n * @returns The list of active orders.\n */\nexport type RampsControllerTransakGetActiveOrdersAction = {\n type: `RampsController:transakGetActiveOrders`;\n handler: RampsController['transakGetActiveOrders'];\n};\n\n/**\n * Union of all RampsController action types.\n */\nexport type RampsControllerMethodActions =\n | RampsControllerExecuteRequestAction\n | RampsControllerAbortRequestAction\n | RampsControllerGetRequestStateAction\n | RampsControllerSetUserRegionAction\n | RampsControllerSetSelectedProviderAction\n | RampsControllerSetSelectedProviderForAssetAction\n | RampsControllerInitAction\n | RampsControllerGetCountriesAction\n | RampsControllerGetTokensAction\n | RampsControllerSetSelectedTokenAction\n | RampsControllerGetProvidersAction\n | RampsControllerGetPaymentMethodsAction\n | RampsControllerSetSelectedPaymentMethodAction\n | RampsControllerGetQuotesAction\n | RampsControllerAddOrderAction\n | RampsControllerRemoveOrderAction\n | RampsControllerStartOrderPollingAction\n | RampsControllerStopOrderPollingAction\n | RampsControllerGetBuyWidgetDataAction\n | RampsControllerAddPrecreatedOrderAction\n | RampsControllerGetOrderAction\n | RampsControllerGetOrderFromCallbackAction\n | RampsControllerTransakSetApiKeyAction\n | RampsControllerTransakSetAccessTokenAction\n | RampsControllerTransakClearAccessTokenAction\n | RampsControllerTransakSetAuthenticatedAction\n | RampsControllerTransakResetStateAction\n | RampsControllerTransakSendUserOtpAction\n | RampsControllerTransakVerifyUserOtpAction\n | RampsControllerTransakLogoutAction\n | RampsControllerTransakGetUserDetailsAction\n | RampsControllerTransakGetBuyQuoteAction\n | RampsControllerTransakGetKycRequirementAction\n | RampsControllerTransakGetAdditionalRequirementsAction\n | RampsControllerTransakCreateOrderAction\n | RampsControllerTransakGetOrderAction\n | RampsControllerTransakGetUserLimitsAction\n | RampsControllerTransakRequestOttAction\n | RampsControllerTransakGeneratePaymentWidgetUrlAction\n | RampsControllerTransakCreateWidgetUrlAction\n | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}