@metamask/ramps-controller 12.0.1 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/RampsController-method-action-types.cjs +1 -1
  3. package/dist/RampsController-method-action-types.cjs.map +1 -1
  4. package/dist/RampsController-method-action-types.d.cts +5 -1
  5. package/dist/RampsController-method-action-types.d.cts.map +1 -1
  6. package/dist/RampsController-method-action-types.d.mts +5 -1
  7. package/dist/RampsController-method-action-types.d.mts.map +1 -1
  8. package/dist/RampsController-method-action-types.mjs +1 -1
  9. package/dist/RampsController-method-action-types.mjs.map +1 -1
  10. package/dist/RampsController.cjs +20 -6
  11. package/dist/RampsController.cjs.map +1 -1
  12. package/dist/RampsController.d.cts +14 -1
  13. package/dist/RampsController.d.cts.map +1 -1
  14. package/dist/RampsController.d.mts +14 -1
  15. package/dist/RampsController.d.mts.map +1 -1
  16. package/dist/RampsController.mjs +20 -6
  17. package/dist/RampsController.mjs.map +1 -1
  18. package/dist/RampsService-method-action-types.cjs +1 -1
  19. package/dist/RampsService-method-action-types.cjs.map +1 -1
  20. package/dist/RampsService-method-action-types.d.cts +5 -3
  21. package/dist/RampsService-method-action-types.d.cts.map +1 -1
  22. package/dist/RampsService-method-action-types.d.mts +5 -3
  23. package/dist/RampsService-method-action-types.d.mts.map +1 -1
  24. package/dist/RampsService-method-action-types.mjs +1 -1
  25. package/dist/RampsService-method-action-types.mjs.map +1 -1
  26. package/dist/RampsService.cjs +11 -5
  27. package/dist/RampsService.cjs.map +1 -1
  28. package/dist/RampsService.d.cts +4 -2
  29. package/dist/RampsService.d.cts.map +1 -1
  30. package/dist/RampsService.d.mts +4 -2
  31. package/dist/RampsService.d.mts.map +1 -1
  32. package/dist/RampsService.mjs +11 -5
  33. package/dist/RampsService.mjs.map +1 -1
  34. package/dist/TransakService-method-action-types.cjs +1 -1
  35. package/dist/TransakService-method-action-types.cjs.map +1 -1
  36. package/dist/TransakService-method-action-types.d.cts +1 -1
  37. package/dist/TransakService-method-action-types.d.mts +1 -1
  38. package/dist/TransakService-method-action-types.mjs +1 -1
  39. package/dist/TransakService-method-action-types.mjs.map +1 -1
  40. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [12.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add `providerAutoSelected` boolean to `RampsControllerState` to track whether the selected provider was system-guessed (soft selection) or user-chosen ([#8305](https://github.com/MetaMask/core/pull/8305))
15
+ - Add optional `options` parameter to `setSelectedProvider` accepting `{ autoSelected?: boolean }` to control the `providerAutoSelected` flag ([#8305](https://github.com/MetaMask/core/pull/8305))
16
+
17
+ ### Changed
18
+
19
+ - Bump `@metamask/base-controller` from `^9.0.0` to `^9.0.1` ([#8317](https://github.com/MetaMask/core/pull/8317))
20
+ - Bump `@metamask/messenger` from `^0.3.0` to `^1.0.0` ([#8317](https://github.com/MetaMask/core/pull/8317))
21
+ - Stop persisting `providers` and `tokens` state across sessions to prevent stale data when API availability changes ([#8307](https://github.com/MetaMask/core/pull/8307))
22
+ - `RampsService.getOrder` and `getOrderFromCallback` accept provider codes with or without a `/providers/` prefix; API paths use the short provider segment. `RampsController` forwards provider ids from order polling to the service without stripping the prefix. ([#8278](https://github.com/MetaMask/core/pull/8278))
23
+
24
+ ### Fixed
25
+
26
+ - `addPrecreatedOrder` normalizes `providerCode` (stripping a leading `/providers/` when present) and sets stub `provider.id` to `/providers/{code}` so precreated stubs match the resource id shape used elsewhere for polling. ([#8289](https://github.com/MetaMask/core/pull/8289))
27
+
10
28
  ## [12.0.1]
11
29
 
12
30
  ### Added
@@ -272,7 +290,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
272
290
  - Add `OnRampService` for interacting with the OnRamp API
273
291
  - Add geolocation detection via IP address lookup
274
292
 
275
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.0.1...HEAD
293
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.1.0...HEAD
294
+ [12.1.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.0.1...@metamask/ramps-controller@12.1.0
276
295
  [12.0.1]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.0.0...@metamask/ramps-controller@12.0.1
277
296
  [12.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@11.0.0...@metamask/ramps-controller@12.0.0
278
297
  [11.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@10.2.0...@metamask/ramps-controller@11.0.0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * This file is auto generated.
4
4
  * Do not edit manually.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController';\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 by ID, or clears the selection.\n * Looks up the provider from the current providers in state and automatically\n * fetches payment methods for that provider.\n *\n * @param providerId - The provider ID (e.g., \"/providers/moonpay\"), or null to clear.\n * @throws If region is not set, providers are not loaded, or provider is not found.\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 * Skips getCountries when countries are already loaded; skips geolocation when\n * 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.fiat - Fiat 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.fiat - Fiat currency code (e.g., \"usd\"). If not provided, uses the user's region currency.\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 by ID.\n * Looks up the payment method from the current payment methods in state.\n *\n * @param paymentMethodId - The payment method ID (e.g., \"/payments/debit-credit-card\"), or null to clear.\n * @throws If payment methods are not loaded or payment method is not found.\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.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 providerOrderId 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 - Provider code (e.g. \"paypal\", \"transak\"), with or without /providers/ prefix.\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 * 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 | 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';\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 by ID, or clears the selection.\n * Looks up the provider from the current providers in state and automatically\n * fetches payment methods for that provider.\n *\n * @param providerId - The provider ID (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 * @throws If region is not set, providers are not loaded, or provider is not found.\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 * Skips getCountries when countries are already loaded; skips geolocation when\n * 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.fiat - Fiat 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.fiat - Fiat currency code (e.g., \"usd\"). If not provided, uses the user's region currency.\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 by ID.\n * Looks up the payment method from the current payment methods in state.\n *\n * @param paymentMethodId - The payment method ID (e.g., \"/payments/debit-credit-card\"), or null to clear.\n * @throws If payment methods are not loaded or payment method is not found.\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.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 providerOrderId 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 - Provider code (e.g. \"paypal\", \"transak\"), with or without /providers/ prefix.\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 * 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 | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
2
+ * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
5
  import type { RampsController } from "./RampsController.cjs";
@@ -69,6 +69,10 @@ export type RampsControllerSetUserRegionAction = {
69
69
  * fetches payment methods for that provider.
70
70
  *
71
71
  * @param providerId - The provider ID (e.g., "/providers/moonpay"), or null to clear.
72
+ * @param options - Optional settings for the selection.
73
+ * @param options.autoSelected - When true, marks the provider as system-guessed
74
+ * (soft selection). The UI will silently auto-switch on token conflict instead
75
+ * of showing the "Token Not Available" modal. Defaults to false.
72
76
  * @throws If region is not set, providers are not loaded, or provider is not found.
73
77
  */
74
78
  export type RampsControllerSetSelectedProviderAction = {
@@ -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,8BAA0B;AAEzD;;;;;;;;;;;;;;;;;;;;;;;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,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O,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;CAChD,CAAC;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,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,8BAA0B;AA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AqD,GACrD,uCAAuC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
2
+ * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
5
  import type { RampsController } from "./RampsController.mjs";
@@ -69,6 +69,10 @@ export type RampsControllerSetUserRegionAction = {
69
69
  * fetches payment methods for that provider.
70
70
  *
71
71
  * @param providerId - The provider ID (e.g., "/providers/moonpay"), or null to clear.
72
+ * @param options - Optional settings for the selection.
73
+ * @param options.autoSelected - When true, marks the provider as system-guessed
74
+ * (soft selection). The UI will silently auto-switch on token conflict instead
75
+ * of showing the "Token Not Available" modal. Defaults to false.
72
76
  * @throws If region is not set, providers are not loaded, or provider is not found.
73
77
  */
74
78
  export type RampsControllerSetSelectedProviderAction = {
@@ -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,8BAA0B;AAEzD;;;;;;;;;;;;;;;;;;;;;;;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,iCA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AAC,oBAAoB,CAAC,CAAC;CAChD,CAAC;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,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,8BAA0B;AAEzD;;;;;;;;;;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uC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
2
+ * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
@@ -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 by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController';\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 by ID, or clears the selection.\n * Looks up the provider from the current providers in state and automatically\n * fetches payment methods for that provider.\n *\n * @param providerId - The provider ID (e.g., \"/providers/moonpay\"), or null to clear.\n * @throws If region is not set, providers are not loaded, or provider is not found.\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 * Skips getCountries when countries are already loaded; skips geolocation when\n * 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.fiat - Fiat 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.fiat - Fiat currency code (e.g., \"usd\"). If not provided, uses the user's region currency.\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 by ID.\n * Looks up the payment method from the current payment methods in state.\n *\n * @param paymentMethodId - The payment method ID (e.g., \"/payments/debit-credit-card\"), or null to clear.\n * @throws If payment methods are not loaded or payment method is not found.\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.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 providerOrderId 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 - Provider code (e.g. \"paypal\", \"transak\"), with or without /providers/ prefix.\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 * 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 | 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';\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 by ID, or clears the selection.\n * Looks up the provider from the current providers in state and automatically\n * fetches payment methods for that provider.\n *\n * @param providerId - The provider ID (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 * @throws If region is not set, providers are not loaded, or provider is not found.\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 * Skips getCountries when countries are already loaded; skips geolocation when\n * 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.fiat - Fiat 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.fiat - Fiat currency code (e.g., \"usd\"). If not provided, uses the user's region currency.\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 by ID.\n * Looks up the payment method from the current payment methods in state.\n *\n * @param paymentMethodId - The payment method ID (e.g., \"/payments/debit-credit-card\"), or null to clear.\n * @throws If payment methods are not loaded or payment method is not found.\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.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 providerOrderId 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 - Provider code (e.g. \"paypal\", \"transak\"), with or without /providers/ prefix.\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 * 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 | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}
@@ -85,13 +85,13 @@ const rampsControllerMetadata = {
85
85
  usedInUi: true,
86
86
  },
87
87
  providers: {
88
- persist: true,
88
+ persist: false,
89
89
  includeInDebugSnapshot: true,
90
90
  includeInStateLogs: true,
91
91
  usedInUi: true,
92
92
  },
93
93
  tokens: {
94
- persist: true,
94
+ persist: false,
95
95
  includeInDebugSnapshot: true,
96
96
  includeInStateLogs: true,
97
97
  usedInUi: true,
@@ -120,6 +120,12 @@ const rampsControllerMetadata = {
120
120
  includeInStateLogs: true,
121
121
  usedInUi: true,
122
122
  },
123
+ providerAutoSelected: {
124
+ persist: true,
125
+ includeInDebugSnapshot: true,
126
+ includeInStateLogs: true,
127
+ usedInUi: true,
128
+ },
123
129
  };
124
130
  /**
125
131
  * Creates a default resource state object.
@@ -163,6 +169,7 @@ function getDefaultRampsControllerState() {
163
169
  },
164
170
  },
165
171
  orders: [],
172
+ providerAutoSelected: false,
166
173
  };
167
174
  }
168
175
  exports.getDefaultRampsControllerState = getDefaultRampsControllerState;
@@ -196,6 +203,7 @@ function resetDependentResources(state, options) {
196
203
  for (const key of DEPENDENT_RESOURCE_KEYS) {
197
204
  resetResource(state, key, defaultState[key]);
198
205
  }
206
+ state.providerAutoSelected = false;
199
207
  }
200
208
  // === HELPER FUNCTIONS ===
201
209
  /**
@@ -580,12 +588,17 @@ class RampsController extends base_controller_1.BaseController {
580
588
  * fetches payment methods for that provider.
581
589
  *
582
590
  * @param providerId - The provider ID (e.g., "/providers/moonpay"), or null to clear.
591
+ * @param options - Optional settings for the selection.
592
+ * @param options.autoSelected - When true, marks the provider as system-guessed
593
+ * (soft selection). The UI will silently auto-switch on token conflict instead
594
+ * of showing the "Token Not Available" modal. Defaults to false.
583
595
  * @throws If region is not set, providers are not loaded, or provider is not found.
584
596
  */
585
- setSelectedProvider(providerId) {
597
+ setSelectedProvider(providerId, options) {
586
598
  if (providerId === null) {
587
599
  this.update((state) => {
588
600
  state.providers.selected = null;
601
+ state.providerAutoSelected = false;
589
602
  resetResource(state, 'paymentMethods');
590
603
  });
591
604
  return;
@@ -609,6 +622,7 @@ class RampsController extends base_controller_1.BaseController {
609
622
  const tokenSupportedByProvider = !(assetId && supportedCryptos?.[assetId] === false);
610
623
  this.update((state) => {
611
624
  state.providers.selected = provider;
625
+ state.providerAutoSelected = options?.autoSelected ?? false;
612
626
  resetResource(state, 'paymentMethods');
613
627
  });
614
628
  if (tokenSupportedByProvider) {
@@ -1114,7 +1128,8 @@ class RampsController extends base_controller_1.BaseController {
1114
1128
  * @returns The unified order data.
1115
1129
  */
1116
1130
  async getOrderFromCallback(providerCode, callbackUrl, wallet) {
1117
- return await this.messenger.call('RampsService:getOrderFromCallback', providerCode, callbackUrl, wallet);
1131
+ const order = await this.messenger.call('RampsService:getOrderFromCallback', providerCode, callbackUrl, wallet);
1132
+ return order;
1118
1133
  }
1119
1134
  /**
1120
1135
  * Sets the Transak API key used for all Transak API requests.
@@ -1625,10 +1640,9 @@ async function _RampsController_refreshOrder(order) {
1625
1640
  if (!providerCode || !order.providerOrderId || !order.walletAddress) {
1626
1641
  return;
1627
1642
  }
1628
- const providerCodeSegment = normalizeProviderCode(providerCode);
1629
1643
  const previousStatus = order.status;
1630
1644
  try {
1631
- const updatedOrder = await this.getOrder(providerCodeSegment, order.providerOrderId, order.walletAddress);
1645
+ const updatedOrder = await this.getOrder(providerCode, order.providerOrderId, order.walletAddress);
1632
1646
  const meta = __classPrivateFieldGet(this, _RampsController_orderPollingMeta, "f").get(order.providerOrderId) ?? {
1633
1647
  lastTimeFetched: 0,
1634
1648
  errorCount: 0,