You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@metamask/ramps-controller

Package Overview
Dependencies
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/ramps-controller - npm Package Compare versions

Comparing version
12.0.0
to
12.0.1
+7
dist/RampsController-method-action-types.cjs
"use strict";
/**
* This file is auto generated by `scripts/generate-method-action-types.ts`.
* Do not edit manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=RampsController-method-action-types.cjs.map
{"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"]}
/**
* This file is auto generated by `scripts/generate-method-action-types.ts`.
* Do not edit manually.
*/
import type { RampsController } from "./RampsController.cjs";
/**
* Executes a request with caching, deduplication, and at most one in-flight
* request per resource type.
*
* 1. **Same cache key in flight** – If a request with this cache key is
* already pending, returns that promise (deduplication; no second request).
*
* 2. **Cache hit** – If valid, non-expired data exists in state.requests for
* this key and forceRefresh is not set, returns that data without fetching.
*
* 3. **New request** – Creates an AbortController and fires the fetcher.
* If options.resourceType is set, tags the pending request with that
* resource type (so #abortDependentRequests can cancel it on region
* change or cleanup) and ref-counts resource-level loading state.
* On success or error, updates request state and resource error;
* in finally, clears resource loading only if this request was not
* aborted.
*
* @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).
* @param fetcher - Async function that performs the fetch. Receives an AbortSignal
* that is aborted when this request is superseded by another for the same resource.
* @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.
* @returns The result of the request (from cache, joined promise, or fetcher).
*/
export type RampsControllerExecuteRequestAction = {
type: `RampsController:executeRequest`;
handler: RampsController['executeRequest'];
};
/**
* Aborts a pending request if one exists.
*
* @param cacheKey - The cache key of the request to abort.
* @returns True if a request was aborted.
*/
export type RampsControllerAbortRequestAction = {
type: `RampsController:abortRequest`;
handler: RampsController['abortRequest'];
};
/**
* Gets the state of a specific cached request.
*
* @param cacheKey - The cache key to look up.
* @returns The request state, or undefined if not cached.
*/
export type RampsControllerGetRequestStateAction = {
type: `RampsController:getRequestState`;
handler: RampsController['getRequestState'];
};
/**
* Sets the user's region manually (without fetching geolocation).
* This allows users to override the detected region.
*
* @param region - The region code to set (e.g., "US-CA").
* @param options - Options for cache behavior.
* @returns The user region object.
*/
export type RampsControllerSetUserRegionAction = {
type: `RampsController:setUserRegion`;
handler: RampsController['setUserRegion'];
};
/**
* Sets the user's selected provider by ID, or clears the selection.
* Looks up the provider from the current providers in state and automatically
* fetches payment methods for that provider.
*
* @param providerId - The provider ID (e.g., "/providers/moonpay"), or null to clear.
* @throws If region is not set, providers are not loaded, or provider is not found.
*/
export type RampsControllerSetSelectedProviderAction = {
type: `RampsController:setSelectedProvider`;
handler: RampsController['setSelectedProvider'];
};
/**
* Initializes the controller by fetching the user's region from geolocation.
* This should be called once at app startup to set up the initial region.
*
* Idempotent: subsequent calls return the same promise unless forceRefresh is set.
* Skips getCountries when countries are already loaded; skips geolocation when
* userRegion already exists.
*
* @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.
* @returns Promise that resolves when initialization is complete.
*/
export type RampsControllerInitAction = {
type: `RampsController:init`;
handler: RampsController['init'];
};
/**
* Fetches the list of supported countries.
* The API returns countries with support information for both buy and sell actions.
* The countries are saved in the controller state once fetched.
*
* @param options - Options for cache behavior.
* @returns An array of countries.
*/
export type RampsControllerGetCountriesAction = {
type: `RampsController:getCountries`;
handler: RampsController['getCountries'];
};
/**
* Fetches the list of available tokens for a given region and action.
* The tokens are saved in the controller state once fetched.
*
* @param region - The region code (e.g., "us", "fr", "us-ny"). If not provided, uses the user's region from controller state.
* @param action - The ramp action type ('buy' or 'sell').
* @param options - Options for cache behavior and query filters.
* @param options.provider - Provider ID(s) to filter by.
* @returns The tokens response containing topTokens and allTokens.
*/
export type RampsControllerGetTokensAction = {
type: `RampsController:getTokens`;
handler: RampsController['getTokens'];
};
/**
* Sets the user's selected token by asset ID.
* Looks up the token from the current tokens in state and automatically
* fetches payment methods for that token.
*
* @param assetId - The asset identifier in CAIP-19 format (e.g., "eip155:1/erc20:0x..."), or undefined to clear.
* @throws If region is not set, tokens are not loaded, or token is not found.
*/
export type RampsControllerSetSelectedTokenAction = {
type: `RampsController:setSelectedToken`;
handler: RampsController['setSelectedToken'];
};
/**
* Fetches the list of providers for a given region.
* The providers are saved in the controller state once fetched.
*
* @param region - The region code (e.g., "us", "fr", "us-ny"). If not provided, uses the user's region from controller state.
* @param options - Options for cache behavior and query filters.
* @param options.provider - Provider ID(s) to filter by.
* @param options.crypto - Crypto currency ID(s) to filter by.
* @param options.fiat - Fiat currency ID(s) to filter by.
* @param options.payments - Payment method ID(s) to filter by.
* @returns The providers response containing providers array.
*/
export type RampsControllerGetProvidersAction = {
type: `RampsController:getProviders`;
handler: RampsController['getProviders'];
};
/**
* Fetches the list of payment methods for a given context.
* The payment methods are saved in the controller state once fetched.
*
* @param region - User's region code (e.g. "fr", "us-ny").
* @param options - Query parameters for filtering payment methods.
* @param options.fiat - Fiat currency code (e.g., "usd"). If not provided, uses the user's region currency.
* @param options.assetId - CAIP-19 cryptocurrency identifier.
* @param options.provider - Provider ID path.
* @returns The payment methods response containing payments array.
*/
export type RampsControllerGetPaymentMethodsAction = {
type: `RampsController:getPaymentMethods`;
handler: RampsController['getPaymentMethods'];
};
/**
* Sets the user's selected payment method by ID.
* Looks up the payment method from the current payment methods in state.
*
* @param paymentMethodId - The payment method ID (e.g., "/payments/debit-credit-card"), or null to clear.
* @throws If payment methods are not loaded or payment method is not found.
*/
export type RampsControllerSetSelectedPaymentMethodAction = {
type: `RampsController:setSelectedPaymentMethod`;
handler: RampsController['setSelectedPaymentMethod'];
};
/**
* Fetches quotes from all providers for a given set of parameters.
* Uses the controller's request cache; callers manage the response in local state.
*
* @param options - The parameters for fetching quotes.
* @param options.region - User's region code. If not provided, uses userRegion from state.
* @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.
* @param options.assetId - CAIP-19 cryptocurrency identifier.
* @param options.amount - The amount (in fiat for buy, crypto for sell).
* @param options.walletAddress - The destination wallet address.
* @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.
* @param options.providers - Optional provider IDs to filter quotes.
* @param options.redirectUrl - Optional redirect URL after order completion.
* @param options.action - The ramp action type. Defaults to 'buy'.
* @param options.forceRefresh - Whether to bypass cache.
* @param options.ttl - Custom TTL for this request.
* @returns The quotes response containing success, sorted, error, and customActions.
*/
export type RampsControllerGetQuotesAction = {
type: `RampsController:getQuotes`;
handler: RampsController['getQuotes'];
};
/**
* Adds or updates a V2 order in controller state.
* If an order with the same providerOrderId already exists, the incoming
* fields are merged on top of the existing order so that fields not present
* in the update (e.g. paymentDetails from the Transak API) are preserved.
*
* @param order - The RampsOrder to add or update.
*/
export type RampsControllerAddOrderAction = {
type: `RampsController:addOrder`;
handler: RampsController['addOrder'];
};
/**
* Removes a V2 order from controller state by providerOrderId.
*
* @param providerOrderId - The provider order ID to remove.
*/
export type RampsControllerRemoveOrderAction = {
type: `RampsController:removeOrder`;
handler: RampsController['removeOrder'];
};
/**
* Starts polling all pending V2 orders at a fixed interval.
* Each poll cycle iterates orders with non-terminal statuses,
* respects pollingSecondsMinimum and backoff from error count.
*/
export type RampsControllerStartOrderPollingAction = {
type: `RampsController:startOrderPolling`;
handler: RampsController['startOrderPolling'];
};
/**
* Stops order polling and clears the interval.
*/
export type RampsControllerStopOrderPollingAction = {
type: `RampsController:stopOrderPolling`;
handler: RampsController['stopOrderPolling'];
};
/**
* Fetches the widget data from a quote for redirect providers.
* Makes a request to the buyURL endpoint via the RampsService to get the
* actual provider widget URL and optional order ID for polling.
*
* @param quote - The quote to fetch the widget URL from.
* @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).
* @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.
*/
export type RampsControllerGetBuyWidgetDataAction = {
type: `RampsController:getBuyWidgetData`;
handler: RampsController['getBuyWidgetData'];
};
/**
* Registers an order ID for polling until the order is created or resolved.
* Adds a minimal stub order to controller state; the existing order polling
* will fetch the full order when the provider has created it.
*
* @param params - Object containing order identifiers and wallet info.
* @param params.orderId - Full order ID (e.g. "/providers/paypal/orders/abc123") or order code.
* @param params.providerCode - Provider code (e.g. "paypal", "transak"), with or without /providers/ prefix.
* @param params.walletAddress - Wallet address for the order.
* @param params.chainId - Optional chain ID for the order.
*/
export type RampsControllerAddPrecreatedOrderAction = {
type: `RampsController:addPrecreatedOrder`;
handler: RampsController['addPrecreatedOrder'];
};
/**
* Fetches an order from the unified V2 API endpoint.
* Returns a normalized RampsOrder for all provider types (aggregator and native).
*
* @param providerCode - The provider code (e.g., "transak", "transak-native", "moonpay").
* @param orderCode - The order identifier.
* @param wallet - The wallet address associated with the order.
* @returns The unified order data.
*/
export type RampsControllerGetOrderAction = {
type: `RampsController:getOrder`;
handler: RampsController['getOrder'];
};
/**
* Extracts an order from a provider callback URL.
* Sends the callback URL to the V2 backend for provider-specific parsing,
* then fetches the full order. This is the V2 equivalent of the aggregator
* SDK's `getOrderFromCallback`.
*
* @param providerCode - The provider code (e.g., "transak", "moonpay").
* @param callbackUrl - The full callback URL the provider redirected to.
* @param wallet - The wallet address associated with the order.
* @returns The unified order data.
*/
export type RampsControllerGetOrderFromCallbackAction = {
type: `RampsController:getOrderFromCallback`;
handler: RampsController['getOrderFromCallback'];
};
/**
* Sets the Transak API key used for all Transak API requests.
*
* @param apiKey - The Transak API key.
*/
export type RampsControllerTransakSetApiKeyAction = {
type: `RampsController:transakSetApiKey`;
handler: RampsController['transakSetApiKey'];
};
/**
* Sets the Transak access token and marks the user as authenticated.
*
* @param token - The access token received from Transak auth.
*/
export type RampsControllerTransakSetAccessTokenAction = {
type: `RampsController:transakSetAccessToken`;
handler: RampsController['transakSetAccessToken'];
};
/**
* Clears the Transak access token and marks the user as unauthenticated.
*/
export type RampsControllerTransakClearAccessTokenAction = {
type: `RampsController:transakClearAccessToken`;
handler: RampsController['transakClearAccessToken'];
};
/**
* Updates the Transak authentication flag in controller state.
*
* @param isAuthenticated - Whether the user is authenticated with Transak.
*/
export type RampsControllerTransakSetAuthenticatedAction = {
type: `RampsController:transakSetAuthenticated`;
handler: RampsController['transakSetAuthenticated'];
};
/**
* Resets all Transak state back to defaults (unauthenticated, no data).
*/
export type RampsControllerTransakResetStateAction = {
type: `RampsController:transakResetState`;
handler: RampsController['transakResetState'];
};
/**
* Sends a one-time password to the user's email for Transak authentication.
*
* @param email - The user's email address.
* @returns The OTP response containing a state token for verification.
*/
export type RampsControllerTransakSendUserOtpAction = {
type: `RampsController:transakSendUserOtp`;
handler: RampsController['transakSendUserOtp'];
};
/**
* Verifies a one-time password and authenticates the user with Transak.
* Updates the controller's authentication state on success.
*
* @param email - The user's email address.
* @param verificationCode - The OTP code entered by the user.
* @param stateToken - The state token from the sendUserOtp response.
* @returns The access token for subsequent authenticated requests.
*/
export type RampsControllerTransakVerifyUserOtpAction = {
type: `RampsController:transakVerifyUserOtp`;
handler: RampsController['transakVerifyUserOtp'];
};
/**
* Logs the user out of Transak. Clears authentication state and user details
* regardless of whether the API call succeeds or fails.
*
* @returns A message indicating the logout result.
*/
export type RampsControllerTransakLogoutAction = {
type: `RampsController:transakLogout`;
handler: RampsController['transakLogout'];
};
/**
* Fetches the authenticated user's details from Transak.
* Updates the userDetails resource state with loading/success/error states.
*
* @returns The user's profile and KYC details.
*/
export type RampsControllerTransakGetUserDetailsAction = {
type: `RampsController:transakGetUserDetails`;
handler: RampsController['transakGetUserDetails'];
};
/**
* Fetches a buy quote from Transak for the given parameters.
* Updates the buyQuote resource state with loading/success/error states.
*
* @param fiatCurrency - The fiat currency code (e.g., "USD").
* @param cryptoCurrency - The cryptocurrency identifier.
* @param network - The blockchain network identifier.
* @param paymentMethod - The payment method identifier.
* @param fiatAmount - The fiat amount as a string.
* @returns The buy quote with pricing and fee details.
*/
export type RampsControllerTransakGetBuyQuoteAction = {
type: `RampsController:transakGetBuyQuote`;
handler: RampsController['transakGetBuyQuote'];
};
/**
* Fetches the KYC requirement for a given quote.
* Updates the kycRequirement resource state with loading/success/error states.
*
* @param quoteId - The quote ID to check KYC requirements for.
* @returns The KYC requirement status and whether the user can place an order.
*/
export type RampsControllerTransakGetKycRequirementAction = {
type: `RampsController:transakGetKycRequirement`;
handler: RampsController['transakGetKycRequirement'];
};
/**
* Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.
*
* @param quoteId - The quote ID to check additional requirements for.
* @returns The list of additional forms required.
*/
export type RampsControllerTransakGetAdditionalRequirementsAction = {
type: `RampsController:transakGetAdditionalRequirements`;
handler: RampsController['transakGetAdditionalRequirements'];
};
/**
* Creates a new order on Transak. If an existing order conflicts (HTTP 409),
* active orders are cancelled and the creation is retried.
*
* @param quoteId - The quote ID to create an order from.
* @param walletAddress - The destination wallet address.
* @param paymentMethodId - The payment method to use.
* @returns The created deposit order.
*/
export type RampsControllerTransakCreateOrderAction = {
type: `RampsController:transakCreateOrder`;
handler: RampsController['transakCreateOrder'];
};
/**
* Fetches an existing order from Transak by order ID.
*
* @param orderId - The order ID (deposit format or raw Transak format).
* @param wallet - The wallet address associated with the order.
* @param paymentDetails - Optional payment details to attach to the order.
* @returns The deposit order details.
*/
export type RampsControllerTransakGetOrderAction = {
type: `RampsController:transakGetOrder`;
handler: RampsController['transakGetOrder'];
};
/**
* Fetches the user's spending limits for a given currency and payment method.
*
* @param fiatCurrency - The fiat currency code.
* @param paymentMethod - The payment method identifier.
* @param kycType - The KYC level type.
* @returns The user's limits, spending, and remaining amounts.
*/
export type RampsControllerTransakGetUserLimitsAction = {
type: `RampsController:transakGetUserLimits`;
handler: RampsController['transakGetUserLimits'];
};
/**
* Requests a one-time token (OTT) for the Transak payment widget.
*
* @returns The OTT response containing the token.
*/
export type RampsControllerTransakRequestOttAction = {
type: `RampsController:transakRequestOtt`;
handler: RampsController['transakRequestOtt'];
};
/**
* Generates a URL for the Transak payment widget with pre-filled parameters.
*
* @param ottToken - The one-time token for widget authentication.
* @param quote - The buy quote to pre-fill in the widget.
* @param walletAddress - The destination wallet address.
* @param extraParams - Optional additional URL parameters.
* @returns The fully constructed widget URL string.
*/
export type RampsControllerTransakGeneratePaymentWidgetUrlAction = {
type: `RampsController:transakGeneratePaymentWidgetUrl`;
handler: RampsController['transakGeneratePaymentWidgetUrl'];
};
/**
* Submits the user's purpose of usage form for KYC compliance.
*
* @param purpose - Array of purpose strings selected by the user.
* @returns A promise that resolves when the form is submitted.
*/
export type RampsControllerTransakSubmitPurposeOfUsageFormAction = {
type: `RampsController:transakSubmitPurposeOfUsageForm`;
handler: RampsController['transakSubmitPurposeOfUsageForm'];
};
/**
* Updates the user's personal or address details on Transak.
*
* @param data - The user data fields to update.
* @returns The API response data.
*/
export type RampsControllerTransakPatchUserAction = {
type: `RampsController:transakPatchUser`;
handler: RampsController['transakPatchUser'];
};
/**
* Submits the user's SSN for identity verification.
*
* @param ssn - The Social Security Number.
* @param quoteId - The quote ID associated with the order requiring SSN.
* @returns The API response data.
*/
export type RampsControllerTransakSubmitSsnDetailsAction = {
type: `RampsController:transakSubmitSsnDetails`;
handler: RampsController['transakSubmitSsnDetails'];
};
/**
* Confirms payment for an order after the user has completed payment.
*
* @param orderId - The order ID to confirm payment for.
* @param paymentMethodId - The payment method used.
* @returns Whether the payment confirmation was successful.
*/
export type RampsControllerTransakConfirmPaymentAction = {
type: `RampsController:transakConfirmPayment`;
handler: RampsController['transakConfirmPayment'];
};
/**
* Translates generic ramps identifiers to Transak-specific identifiers.
*
* @param request - The translation request with optional identifiers to translate.
* @returns The translated Transak-specific identifiers.
*/
export type RampsControllerTransakGetTranslationAction = {
type: `RampsController:transakGetTranslation`;
handler: RampsController['transakGetTranslation'];
};
/**
* Checks the status of an ID proof submission for KYC.
*
* @param workFlowRunId - The workflow run ID to check status for.
* @returns The current ID proof status.
*/
export type RampsControllerTransakGetIdProofStatusAction = {
type: `RampsController:transakGetIdProofStatus`;
handler: RampsController['transakGetIdProofStatus'];
};
/**
* Cancels a specific Transak order.
*
* @param depositOrderId - The deposit order ID to cancel.
* @returns A promise that resolves when the order is cancelled.
*/
export type RampsControllerTransakCancelOrderAction = {
type: `RampsController:transakCancelOrder`;
handler: RampsController['transakCancelOrder'];
};
/**
* Cancels all active Transak orders. Individual cancellation failures
* are collected and returned rather than thrown.
*
* @returns An array of errors from any failed cancellations (empty if all succeeded).
*/
export type RampsControllerTransakCancelAllActiveOrdersAction = {
type: `RampsController:transakCancelAllActiveOrders`;
handler: RampsController['transakCancelAllActiveOrders'];
};
/**
* Fetches all active Transak orders for the authenticated user.
*
* @returns The list of active orders.
*/
export type RampsControllerTransakGetActiveOrdersAction = {
type: `RampsController:transakGetActiveOrders`;
handler: RampsController['transakGetActiveOrders'];
};
/**
* Union of all RampsController action types.
*/
export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
//# sourceMappingURL=RampsController-method-action-types.d.cts.map
{"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,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe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CAAqC,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"}
/**
* This file is auto generated by `scripts/generate-method-action-types.ts`.
* Do not edit manually.
*/
import type { RampsController } from "./RampsController.mjs";
/**
* Executes a request with caching, deduplication, and at most one in-flight
* request per resource type.
*
* 1. **Same cache key in flight** – If a request with this cache key is
* already pending, returns that promise (deduplication; no second request).
*
* 2. **Cache hit** – If valid, non-expired data exists in state.requests for
* this key and forceRefresh is not set, returns that data without fetching.
*
* 3. **New request** – Creates an AbortController and fires the fetcher.
* If options.resourceType is set, tags the pending request with that
* resource type (so #abortDependentRequests can cancel it on region
* change or cleanup) and ref-counts resource-level loading state.
* On success or error, updates request state and resource error;
* in finally, clears resource loading only if this request was not
* aborted.
*
* @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).
* @param fetcher - Async function that performs the fetch. Receives an AbortSignal
* that is aborted when this request is superseded by another for the same resource.
* @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.
* @returns The result of the request (from cache, joined promise, or fetcher).
*/
export type RampsControllerExecuteRequestAction = {
type: `RampsController:executeRequest`;
handler: RampsController['executeRequest'];
};
/**
* Aborts a pending request if one exists.
*
* @param cacheKey - The cache key of the request to abort.
* @returns True if a request was aborted.
*/
export type RampsControllerAbortRequestAction = {
type: `RampsController:abortRequest`;
handler: RampsController['abortRequest'];
};
/**
* Gets the state of a specific cached request.
*
* @param cacheKey - The cache key to look up.
* @returns The request state, or undefined if not cached.
*/
export type RampsControllerGetRequestStateAction = {
type: `RampsController:getRequestState`;
handler: RampsController['getRequestState'];
};
/**
* Sets the user's region manually (without fetching geolocation).
* This allows users to override the detected region.
*
* @param region - The region code to set (e.g., "US-CA").
* @param options - Options for cache behavior.
* @returns The user region object.
*/
export type RampsControllerSetUserRegionAction = {
type: `RampsController:setUserRegion`;
handler: RampsController['setUserRegion'];
};
/**
* Sets the user's selected provider by ID, or clears the selection.
* Looks up the provider from the current providers in state and automatically
* fetches payment methods for that provider.
*
* @param providerId - The provider ID (e.g., "/providers/moonpay"), or null to clear.
* @throws If region is not set, providers are not loaded, or provider is not found.
*/
export type RampsControllerSetSelectedProviderAction = {
type: `RampsController:setSelectedProvider`;
handler: RampsController['setSelectedProvider'];
};
/**
* Initializes the controller by fetching the user's region from geolocation.
* This should be called once at app startup to set up the initial region.
*
* Idempotent: subsequent calls return the same promise unless forceRefresh is set.
* Skips getCountries when countries are already loaded; skips geolocation when
* userRegion already exists.
*
* @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.
* @returns Promise that resolves when initialization is complete.
*/
export type RampsControllerInitAction = {
type: `RampsController:init`;
handler: RampsController['init'];
};
/**
* Fetches the list of supported countries.
* The API returns countries with support information for both buy and sell actions.
* The countries are saved in the controller state once fetched.
*
* @param options - Options for cache behavior.
* @returns An array of countries.
*/
export type RampsControllerGetCountriesAction = {
type: `RampsController:getCountries`;
handler: RampsController['getCountries'];
};
/**
* Fetches the list of available tokens for a given region and action.
* The tokens are saved in the controller state once fetched.
*
* @param region - The region code (e.g., "us", "fr", "us-ny"). If not provided, uses the user's region from controller state.
* @param action - The ramp action type ('buy' or 'sell').
* @param options - Options for cache behavior and query filters.
* @param options.provider - Provider ID(s) to filter by.
* @returns The tokens response containing topTokens and allTokens.
*/
export type RampsControllerGetTokensAction = {
type: `RampsController:getTokens`;
handler: RampsController['getTokens'];
};
/**
* Sets the user's selected token by asset ID.
* Looks up the token from the current tokens in state and automatically
* fetches payment methods for that token.
*
* @param assetId - The asset identifier in CAIP-19 format (e.g., "eip155:1/erc20:0x..."), or undefined to clear.
* @throws If region is not set, tokens are not loaded, or token is not found.
*/
export type RampsControllerSetSelectedTokenAction = {
type: `RampsController:setSelectedToken`;
handler: RampsController['setSelectedToken'];
};
/**
* Fetches the list of providers for a given region.
* The providers are saved in the controller state once fetched.
*
* @param region - The region code (e.g., "us", "fr", "us-ny"). If not provided, uses the user's region from controller state.
* @param options - Options for cache behavior and query filters.
* @param options.provider - Provider ID(s) to filter by.
* @param options.crypto - Crypto currency ID(s) to filter by.
* @param options.fiat - Fiat currency ID(s) to filter by.
* @param options.payments - Payment method ID(s) to filter by.
* @returns The providers response containing providers array.
*/
export type RampsControllerGetProvidersAction = {
type: `RampsController:getProviders`;
handler: RampsController['getProviders'];
};
/**
* Fetches the list of payment methods for a given context.
* The payment methods are saved in the controller state once fetched.
*
* @param region - User's region code (e.g. "fr", "us-ny").
* @param options - Query parameters for filtering payment methods.
* @param options.fiat - Fiat currency code (e.g., "usd"). If not provided, uses the user's region currency.
* @param options.assetId - CAIP-19 cryptocurrency identifier.
* @param options.provider - Provider ID path.
* @returns The payment methods response containing payments array.
*/
export type RampsControllerGetPaymentMethodsAction = {
type: `RampsController:getPaymentMethods`;
handler: RampsController['getPaymentMethods'];
};
/**
* Sets the user's selected payment method by ID.
* Looks up the payment method from the current payment methods in state.
*
* @param paymentMethodId - The payment method ID (e.g., "/payments/debit-credit-card"), or null to clear.
* @throws If payment methods are not loaded or payment method is not found.
*/
export type RampsControllerSetSelectedPaymentMethodAction = {
type: `RampsController:setSelectedPaymentMethod`;
handler: RampsController['setSelectedPaymentMethod'];
};
/**
* Fetches quotes from all providers for a given set of parameters.
* Uses the controller's request cache; callers manage the response in local state.
*
* @param options - The parameters for fetching quotes.
* @param options.region - User's region code. If not provided, uses userRegion from state.
* @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.
* @param options.assetId - CAIP-19 cryptocurrency identifier.
* @param options.amount - The amount (in fiat for buy, crypto for sell).
* @param options.walletAddress - The destination wallet address.
* @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.
* @param options.providers - Optional provider IDs to filter quotes.
* @param options.redirectUrl - Optional redirect URL after order completion.
* @param options.action - The ramp action type. Defaults to 'buy'.
* @param options.forceRefresh - Whether to bypass cache.
* @param options.ttl - Custom TTL for this request.
* @returns The quotes response containing success, sorted, error, and customActions.
*/
export type RampsControllerGetQuotesAction = {
type: `RampsController:getQuotes`;
handler: RampsController['getQuotes'];
};
/**
* Adds or updates a V2 order in controller state.
* If an order with the same providerOrderId already exists, the incoming
* fields are merged on top of the existing order so that fields not present
* in the update (e.g. paymentDetails from the Transak API) are preserved.
*
* @param order - The RampsOrder to add or update.
*/
export type RampsControllerAddOrderAction = {
type: `RampsController:addOrder`;
handler: RampsController['addOrder'];
};
/**
* Removes a V2 order from controller state by providerOrderId.
*
* @param providerOrderId - The provider order ID to remove.
*/
export type RampsControllerRemoveOrderAction = {
type: `RampsController:removeOrder`;
handler: RampsController['removeOrder'];
};
/**
* Starts polling all pending V2 orders at a fixed interval.
* Each poll cycle iterates orders with non-terminal statuses,
* respects pollingSecondsMinimum and backoff from error count.
*/
export type RampsControllerStartOrderPollingAction = {
type: `RampsController:startOrderPolling`;
handler: RampsController['startOrderPolling'];
};
/**
* Stops order polling and clears the interval.
*/
export type RampsControllerStopOrderPollingAction = {
type: `RampsController:stopOrderPolling`;
handler: RampsController['stopOrderPolling'];
};
/**
* Fetches the widget data from a quote for redirect providers.
* Makes a request to the buyURL endpoint via the RampsService to get the
* actual provider widget URL and optional order ID for polling.
*
* @param quote - The quote to fetch the widget URL from.
* @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).
* @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.
*/
export type RampsControllerGetBuyWidgetDataAction = {
type: `RampsController:getBuyWidgetData`;
handler: RampsController['getBuyWidgetData'];
};
/**
* Registers an order ID for polling until the order is created or resolved.
* Adds a minimal stub order to controller state; the existing order polling
* will fetch the full order when the provider has created it.
*
* @param params - Object containing order identifiers and wallet info.
* @param params.orderId - Full order ID (e.g. "/providers/paypal/orders/abc123") or order code.
* @param params.providerCode - Provider code (e.g. "paypal", "transak"), with or without /providers/ prefix.
* @param params.walletAddress - Wallet address for the order.
* @param params.chainId - Optional chain ID for the order.
*/
export type RampsControllerAddPrecreatedOrderAction = {
type: `RampsController:addPrecreatedOrder`;
handler: RampsController['addPrecreatedOrder'];
};
/**
* Fetches an order from the unified V2 API endpoint.
* Returns a normalized RampsOrder for all provider types (aggregator and native).
*
* @param providerCode - The provider code (e.g., "transak", "transak-native", "moonpay").
* @param orderCode - The order identifier.
* @param wallet - The wallet address associated with the order.
* @returns The unified order data.
*/
export type RampsControllerGetOrderAction = {
type: `RampsController:getOrder`;
handler: RampsController['getOrder'];
};
/**
* Extracts an order from a provider callback URL.
* Sends the callback URL to the V2 backend for provider-specific parsing,
* then fetches the full order. This is the V2 equivalent of the aggregator
* SDK's `getOrderFromCallback`.
*
* @param providerCode - The provider code (e.g., "transak", "moonpay").
* @param callbackUrl - The full callback URL the provider redirected to.
* @param wallet - The wallet address associated with the order.
* @returns The unified order data.
*/
export type RampsControllerGetOrderFromCallbackAction = {
type: `RampsController:getOrderFromCallback`;
handler: RampsController['getOrderFromCallback'];
};
/**
* Sets the Transak API key used for all Transak API requests.
*
* @param apiKey - The Transak API key.
*/
export type RampsControllerTransakSetApiKeyAction = {
type: `RampsController:transakSetApiKey`;
handler: RampsController['transakSetApiKey'];
};
/**
* Sets the Transak access token and marks the user as authenticated.
*
* @param token - The access token received from Transak auth.
*/
export type RampsControllerTransakSetAccessTokenAction = {
type: `RampsController:transakSetAccessToken`;
handler: RampsController['transakSetAccessToken'];
};
/**
* Clears the Transak access token and marks the user as unauthenticated.
*/
export type RampsControllerTransakClearAccessTokenAction = {
type: `RampsController:transakClearAccessToken`;
handler: RampsController['transakClearAccessToken'];
};
/**
* Updates the Transak authentication flag in controller state.
*
* @param isAuthenticated - Whether the user is authenticated with Transak.
*/
export type RampsControllerTransakSetAuthenticatedAction = {
type: `RampsController:transakSetAuthenticated`;
handler: RampsController['transakSetAuthenticated'];
};
/**
* Resets all Transak state back to defaults (unauthenticated, no data).
*/
export type RampsControllerTransakResetStateAction = {
type: `RampsController:transakResetState`;
handler: RampsController['transakResetState'];
};
/**
* Sends a one-time password to the user's email for Transak authentication.
*
* @param email - The user's email address.
* @returns The OTP response containing a state token for verification.
*/
export type RampsControllerTransakSendUserOtpAction = {
type: `RampsController:transakSendUserOtp`;
handler: RampsController['transakSendUserOtp'];
};
/**
* Verifies a one-time password and authenticates the user with Transak.
* Updates the controller's authentication state on success.
*
* @param email - The user's email address.
* @param verificationCode - The OTP code entered by the user.
* @param stateToken - The state token from the sendUserOtp response.
* @returns The access token for subsequent authenticated requests.
*/
export type RampsControllerTransakVerifyUserOtpAction = {
type: `RampsController:transakVerifyUserOtp`;
handler: RampsController['transakVerifyUserOtp'];
};
/**
* Logs the user out of Transak. Clears authentication state and user details
* regardless of whether the API call succeeds or fails.
*
* @returns A message indicating the logout result.
*/
export type RampsControllerTransakLogoutAction = {
type: `RampsController:transakLogout`;
handler: RampsController['transakLogout'];
};
/**
* Fetches the authenticated user's details from Transak.
* Updates the userDetails resource state with loading/success/error states.
*
* @returns The user's profile and KYC details.
*/
export type RampsControllerTransakGetUserDetailsAction = {
type: `RampsController:transakGetUserDetails`;
handler: RampsController['transakGetUserDetails'];
};
/**
* Fetches a buy quote from Transak for the given parameters.
* Updates the buyQuote resource state with loading/success/error states.
*
* @param fiatCurrency - The fiat currency code (e.g., "USD").
* @param cryptoCurrency - The cryptocurrency identifier.
* @param network - The blockchain network identifier.
* @param paymentMethod - The payment method identifier.
* @param fiatAmount - The fiat amount as a string.
* @returns The buy quote with pricing and fee details.
*/
export type RampsControllerTransakGetBuyQuoteAction = {
type: `RampsController:transakGetBuyQuote`;
handler: RampsController['transakGetBuyQuote'];
};
/**
* Fetches the KYC requirement for a given quote.
* Updates the kycRequirement resource state with loading/success/error states.
*
* @param quoteId - The quote ID to check KYC requirements for.
* @returns The KYC requirement status and whether the user can place an order.
*/
export type RampsControllerTransakGetKycRequirementAction = {
type: `RampsController:transakGetKycRequirement`;
handler: RampsController['transakGetKycRequirement'];
};
/**
* Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.
*
* @param quoteId - The quote ID to check additional requirements for.
* @returns The list of additional forms required.
*/
export type RampsControllerTransakGetAdditionalRequirementsAction = {
type: `RampsController:transakGetAdditionalRequirements`;
handler: RampsController['transakGetAdditionalRequirements'];
};
/**
* Creates a new order on Transak. If an existing order conflicts (HTTP 409),
* active orders are cancelled and the creation is retried.
*
* @param quoteId - The quote ID to create an order from.
* @param walletAddress - The destination wallet address.
* @param paymentMethodId - The payment method to use.
* @returns The created deposit order.
*/
export type RampsControllerTransakCreateOrderAction = {
type: `RampsController:transakCreateOrder`;
handler: RampsController['transakCreateOrder'];
};
/**
* Fetches an existing order from Transak by order ID.
*
* @param orderId - The order ID (deposit format or raw Transak format).
* @param wallet - The wallet address associated with the order.
* @param paymentDetails - Optional payment details to attach to the order.
* @returns The deposit order details.
*/
export type RampsControllerTransakGetOrderAction = {
type: `RampsController:transakGetOrder`;
handler: RampsController['transakGetOrder'];
};
/**
* Fetches the user's spending limits for a given currency and payment method.
*
* @param fiatCurrency - The fiat currency code.
* @param paymentMethod - The payment method identifier.
* @param kycType - The KYC level type.
* @returns The user's limits, spending, and remaining amounts.
*/
export type RampsControllerTransakGetUserLimitsAction = {
type: `RampsController:transakGetUserLimits`;
handler: RampsController['transakGetUserLimits'];
};
/**
* Requests a one-time token (OTT) for the Transak payment widget.
*
* @returns The OTT response containing the token.
*/
export type RampsControllerTransakRequestOttAction = {
type: `RampsController:transakRequestOtt`;
handler: RampsController['transakRequestOtt'];
};
/**
* Generates a URL for the Transak payment widget with pre-filled parameters.
*
* @param ottToken - The one-time token for widget authentication.
* @param quote - The buy quote to pre-fill in the widget.
* @param walletAddress - The destination wallet address.
* @param extraParams - Optional additional URL parameters.
* @returns The fully constructed widget URL string.
*/
export type RampsControllerTransakGeneratePaymentWidgetUrlAction = {
type: `RampsController:transakGeneratePaymentWidgetUrl`;
handler: RampsController['transakGeneratePaymentWidgetUrl'];
};
/**
* Submits the user's purpose of usage form for KYC compliance.
*
* @param purpose - Array of purpose strings selected by the user.
* @returns A promise that resolves when the form is submitted.
*/
export type RampsControllerTransakSubmitPurposeOfUsageFormAction = {
type: `RampsController:transakSubmitPurposeOfUsageForm`;
handler: RampsController['transakSubmitPurposeOfUsageForm'];
};
/**
* Updates the user's personal or address details on Transak.
*
* @param data - The user data fields to update.
* @returns The API response data.
*/
export type RampsControllerTransakPatchUserAction = {
type: `RampsController:transakPatchUser`;
handler: RampsController['transakPatchUser'];
};
/**
* Submits the user's SSN for identity verification.
*
* @param ssn - The Social Security Number.
* @param quoteId - The quote ID associated with the order requiring SSN.
* @returns The API response data.
*/
export type RampsControllerTransakSubmitSsnDetailsAction = {
type: `RampsController:transakSubmitSsnDetails`;
handler: RampsController['transakSubmitSsnDetails'];
};
/**
* Confirms payment for an order after the user has completed payment.
*
* @param orderId - The order ID to confirm payment for.
* @param paymentMethodId - The payment method used.
* @returns Whether the payment confirmation was successful.
*/
export type RampsControllerTransakConfirmPaymentAction = {
type: `RampsController:transakConfirmPayment`;
handler: RampsController['transakConfirmPayment'];
};
/**
* Translates generic ramps identifiers to Transak-specific identifiers.
*
* @param request - The translation request with optional identifiers to translate.
* @returns The translated Transak-specific identifiers.
*/
export type RampsControllerTransakGetTranslationAction = {
type: `RampsController:transakGetTranslation`;
handler: RampsController['transakGetTranslation'];
};
/**
* Checks the status of an ID proof submission for KYC.
*
* @param workFlowRunId - The workflow run ID to check status for.
* @returns The current ID proof status.
*/
export type RampsControllerTransakGetIdProofStatusAction = {
type: `RampsController:transakGetIdProofStatus`;
handler: RampsController['transakGetIdProofStatus'];
};
/**
* Cancels a specific Transak order.
*
* @param depositOrderId - The deposit order ID to cancel.
* @returns A promise that resolves when the order is cancelled.
*/
export type RampsControllerTransakCancelOrderAction = {
type: `RampsController:transakCancelOrder`;
handler: RampsController['transakCancelOrder'];
};
/**
* Cancels all active Transak orders. Individual cancellation failures
* are collected and returned rather than thrown.
*
* @returns An array of errors from any failed cancellations (empty if all succeeded).
*/
export type RampsControllerTransakCancelAllActiveOrdersAction = {
type: `RampsController:transakCancelAllActiveOrders`;
handler: RampsController['transakCancelAllActiveOrders'];
};
/**
* Fetches all active Transak orders for the authenticated user.
*
* @returns The list of active orders.
*/
export type RampsControllerTransakGetActiveOrdersAction = {
type: `RampsController:transakGetActiveOrders`;
handler: RampsController['transakGetActiveOrders'];
};
/**
* Union of all RampsController action types.
*/
export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
//# sourceMappingURL=RampsController-method-action-types.d.mts.map
{"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,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC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,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"}
/**
* This file is auto generated by `scripts/generate-method-action-types.ts`.
* Do not edit manually.
*/
export {};
//# sourceMappingURL=RampsController-method-action-types.mjs.map
{"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"]}
+60
-1

@@ -10,2 +10,60 @@ # Changelog

## [12.0.1]
### Added
- Expose all public `RampsController` methods through its messenger ([#8221](https://github.com/MetaMask/core/pull/8221))
- The following actions are now available:
- `RampsController:executeRequest`
- `RampsController:abortRequest`
- `RampsController:getRequestState`
- `RampsController:setUserRegion`
- `RampsController:setSelectedProvider`
- `RampsController:init`
- `RampsController:getCountries`
- `RampsController:getTokens`
- `RampsController:getProviders`
- `RampsController:getPaymentMethods`
- `RampsController:setSelectedPaymentMethod`
- `RampsController:addOrder`
- `RampsController:removeOrder`
- `RampsController:startOrderPolling`
- `RampsController:stopOrderPolling`
- `RampsController:getBuyWidgetData`
- `RampsController:addPrecreatedOrder`
- `RampsController:getOrderFromCallback`
- `RampsController:transakSetApiKey`
- `RampsController:transakSetAccessToken`
- `RampsController:transakClearAccessToken`
- `RampsController:transakSetAuthenticated`
- `RampsController:transakResetState`
- `RampsController:transakSendUserOtp`
- `RampsController:transakVerifyUserOtp`
- `RampsController:transakLogout`
- `RampsController:transakGetUserDetails`
- `RampsController:transakGetBuyQuote`
- `RampsController:transakGetKycRequirement`
- `RampsController:transakGetAdditionalRequirements`
- `RampsController:transakCreateOrder`
- `RampsController:transakGetOrder`
- `RampsController:transakGetUserLimits`
- `RampsController:transakRequestOtt`
- `RampsController:transakGeneratePaymentWidgetUrl`
- `RampsController:transakSubmitPurposeOfUsageForm`
- `RampsController:transakPatchUser`
- `RampsController:transakSubmitSsnDetails`
- `RampsController:transakConfirmPayment`
- `RampsController:transakGetTranslation`
- `RampsController:transakGetIdProofStatus`
- `RampsController:transakCancelOrder`
- `RampsController:transakCancelAllActiveOrders`
- `RampsController:transakGetActiveOrders`
- Corresponding action types are now exported (e.g. `RampsControllerGetOrderAction`)
### Fixed
- Fix `getOrder` wallet handling so API requests and event payloads stay valid and consistent ([#8251](https://github.com/MetaMask/core/pull/8251))
- `RampsService.getOrder` no longer sends an empty `wallet` query parameter, avoiding invalid API responses (e.g. 400).
- `RampsController.getOrder` persists and returns a healed order (`walletAddress` and `providerOrderId`) so controller state matches the return value and `RampsController:orderStatusChanged` listeners.
## [12.0.0]

@@ -218,3 +276,4 @@

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.0.1...HEAD
[12.0.1]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@12.0.0...@metamask/ramps-controller@12.0.1
[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@11.0.0...@metamask/ramps-controller@12.0.0

@@ -221,0 +280,0 @@ [11.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@10.2.0...@metamask/ramps-controller@11.0.0

+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAiBA,yDAK2B;AAJzB,kHAAA,eAAe,OAAA;AACf,iIAAA,8BAA8B,OAAA;AAC9B,wHAAA,qBAAqB,OAAA;AACrB,4IAAA,yCAAyC,OAAA;AAmC3C,mDAMwB;AALtB,4GAAA,YAAY,OAAA;AACZ,gHAAA,gBAAgB,OAAA;AAChB,+GAAA,eAAe,OAAA;AACf,gHAAA,gBAAgB,OAAA;AAChB,iHAAA,iBAAiB,OAAA;AAkBnB,mDASwB;AARtB,6GAAA,aAAa,OAAA;AACb,yHAAA,yBAAyB,OAAA;AACzB,8HAAA,8BAA8B,OAAA;AAC9B,8GAAA,cAAc,OAAA;AACd,8GAAA,cAAc,OAAA;AACd,kHAAA,kBAAkB,OAAA;AAClB,kHAAA,kBAAkB,OAAA;AAClB,gHAAA,gBAAgB,OAAA;AAGlB,6CAAoD;AAA3C,kHAAA,qBAAqB,OAAA;AA2B9B,uDAK0B;AAJxB,iHAAA,eAAe,OAAA;AACf,gHAAA,cAAc,OAAA;AACd,oHAAA,kBAAkB,OAAA;AAClB,2HAAA,yBAAyB,OAAA","sourcesContent":["export type {\n RampsControllerActions,\n RampsControllerEvents,\n RampsControllerGetStateAction,\n RampsControllerSetSelectedTokenAction,\n RampsControllerGetQuotesAction,\n RampsControllerGetOrderAction,\n RampsControllerMessenger,\n RampsControllerState,\n RampsControllerStateChangeEvent,\n RampsControllerOrderStatusChangedEvent,\n RampsControllerOptions,\n UserRegion,\n ResourceState,\n TransakState,\n NativeProvidersState,\n} from './RampsController';\nexport {\n RampsController,\n getDefaultRampsControllerState,\n normalizeProviderCode,\n RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS,\n} from './RampsController';\nexport type {\n RampsServiceActions,\n RampsServiceEvents,\n RampsServiceMessenger,\n Country,\n State,\n SupportedActions,\n CountryPhone,\n Provider,\n ProviderLink,\n ProviderLogos,\n ProviderBrowserType,\n RampAction,\n PaymentMethod,\n PaymentMethodsResponse,\n Quote,\n QuoteError,\n QuoteSortBy,\n QuoteSortOrder,\n QuoteCryptoTranslation,\n QuoteCustomAction,\n QuotesResponse,\n GetQuotesParams,\n RampsToken,\n TokensResponse,\n BuyWidget,\n RampsOrder,\n RampsOrderNetwork,\n RampsOrderCryptoCurrency,\n RampsOrderFiatCurrency,\n RampsOrderPaymentMethod,\n OrderPaymentDetail,\n} from './RampsService';\nexport {\n RampsService,\n RampsEnvironment,\n RampsApiService,\n RampsOrderStatus,\n RAMPS_SDK_VERSION,\n} from './RampsService';\nexport type {\n RampsServiceGetGeolocationAction,\n RampsServiceGetCountriesAction,\n RampsServiceGetPaymentMethodsAction,\n RampsServiceGetQuotesAction,\n RampsServiceGetBuyWidgetUrlAction,\n RampsServiceGetOrderAction,\n RampsServiceGetOrderFromCallbackAction,\n} from './RampsService-method-action-types';\nexport type {\n RequestCache,\n RequestState,\n ExecuteRequestOptions,\n PendingRequest,\n ResourceType,\n} from './RequestCache';\nexport {\n RequestStatus,\n DEFAULT_REQUEST_CACHE_TTL,\n DEFAULT_REQUEST_CACHE_MAX_SIZE,\n createCacheKey,\n isCacheExpired,\n createLoadingState,\n createSuccessState,\n createErrorState,\n} from './RequestCache';\nexport type { RequestSelectorResult } from './selectors';\nexport { createRequestSelector } from './selectors';\nexport type {\n TransakServiceActions,\n TransakServiceEvents,\n TransakServiceMessenger,\n TransakAccessToken,\n TransakUserDetails,\n TransakUserDetailsAddress,\n TransakUserDetailsKycDetails,\n TransakBuyQuote,\n TransakKycRequirement,\n TransakAdditionalRequirement,\n TransakAdditionalRequirementsResponse,\n TransakOttResponse,\n TransakOrderPaymentMethod,\n TransakDepositOrder,\n TransakDepositNetwork,\n TransakDepositCryptoCurrency,\n TransakDepositPaymentMethod,\n TransakDepositRegion,\n TransakOrder,\n TransakQuoteTranslation,\n TransakTranslationRequest,\n TransakUserLimits,\n TransakIdProofStatus,\n PatchUserRequestBody as TransakPatchUserRequestBody,\n} from './TransakService';\nexport {\n TransakApiError,\n TransakService,\n TransakEnvironment,\n TransakOrderIdTransformer,\n} from './TransakService';\nexport type {\n TransakServiceMethodActions,\n TransakServiceSendUserOtpAction,\n TransakServiceVerifyUserOtpAction,\n TransakServiceGetUserDetailsAction,\n TransakServiceGetBuyQuoteAction,\n TransakServiceGetKycRequirementAction,\n TransakServiceCreateOrderAction,\n TransakServiceGetOrderAction,\n TransakServiceRequestOttAction,\n TransakServiceGeneratePaymentWidgetUrlAction,\n} from './TransakService-method-action-types';\n"]}
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA+DA,yDAK2B;AAJzB,kHAAA,eAAe,OAAA;AACf,iIAAA,8BAA8B,OAAA;AAC9B,wHAAA,qBAAqB,OAAA;AACrB,4IAAA,yCAAyC,OAAA;AAmC3C,mDAMwB;AALtB,4GAAA,YAAY,OAAA;AACZ,gHAAA,gBAAgB,OAAA;AAChB,+GAAA,eAAe,OAAA;AACf,gHAAA,gBAAgB,OAAA;AAChB,iHAAA,iBAAiB,OAAA;AAkBnB,mDASwB;AARtB,6GAAA,aAAa,OAAA;AACb,yHAAA,yBAAyB,OAAA;AACzB,8HAAA,8BAA8B,OAAA;AAC9B,8GAAA,cAAc,OAAA;AACd,8GAAA,cAAc,OAAA;AACd,kHAAA,kBAAkB,OAAA;AAClB,kHAAA,kBAAkB,OAAA;AAClB,gHAAA,gBAAgB,OAAA;AAGlB,6CAAoD;AAA3C,kHAAA,qBAAqB,OAAA;AA2B9B,uDAK0B;AAJxB,iHAAA,eAAe,OAAA;AACf,gHAAA,cAAc,OAAA;AACd,oHAAA,kBAAkB,OAAA;AAClB,2HAAA,yBAAyB,OAAA","sourcesContent":["export type {\n RampsControllerActions,\n RampsControllerEvents,\n RampsControllerGetStateAction,\n RampsControllerMessenger,\n RampsControllerState,\n RampsControllerStateChangeEvent,\n RampsControllerOrderStatusChangedEvent,\n RampsControllerOptions,\n UserRegion,\n ResourceState,\n TransakState,\n NativeProvidersState,\n} from './RampsController';\nexport type {\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} from './RampsController-method-action-types';\nexport {\n RampsController,\n getDefaultRampsControllerState,\n normalizeProviderCode,\n RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS,\n} from './RampsController';\nexport type {\n RampsServiceActions,\n RampsServiceEvents,\n RampsServiceMessenger,\n Country,\n State,\n SupportedActions,\n CountryPhone,\n Provider,\n ProviderLink,\n ProviderLogos,\n ProviderBrowserType,\n RampAction,\n PaymentMethod,\n PaymentMethodsResponse,\n Quote,\n QuoteError,\n QuoteSortBy,\n QuoteSortOrder,\n QuoteCryptoTranslation,\n QuoteCustomAction,\n QuotesResponse,\n GetQuotesParams,\n RampsToken,\n TokensResponse,\n BuyWidget,\n RampsOrder,\n RampsOrderNetwork,\n RampsOrderCryptoCurrency,\n RampsOrderFiatCurrency,\n RampsOrderPaymentMethod,\n OrderPaymentDetail,\n} from './RampsService';\nexport {\n RampsService,\n RampsEnvironment,\n RampsApiService,\n RampsOrderStatus,\n RAMPS_SDK_VERSION,\n} from './RampsService';\nexport type {\n RampsServiceGetGeolocationAction,\n RampsServiceGetCountriesAction,\n RampsServiceGetPaymentMethodsAction,\n RampsServiceGetQuotesAction,\n RampsServiceGetBuyWidgetUrlAction,\n RampsServiceGetOrderAction,\n RampsServiceGetOrderFromCallbackAction,\n} from './RampsService-method-action-types';\nexport type {\n RequestCache,\n RequestState,\n ExecuteRequestOptions,\n PendingRequest,\n ResourceType,\n} from './RequestCache';\nexport {\n RequestStatus,\n DEFAULT_REQUEST_CACHE_TTL,\n DEFAULT_REQUEST_CACHE_MAX_SIZE,\n createCacheKey,\n isCacheExpired,\n createLoadingState,\n createSuccessState,\n createErrorState,\n} from './RequestCache';\nexport type { RequestSelectorResult } from './selectors';\nexport { createRequestSelector } from './selectors';\nexport type {\n TransakServiceActions,\n TransakServiceEvents,\n TransakServiceMessenger,\n TransakAccessToken,\n TransakUserDetails,\n TransakUserDetailsAddress,\n TransakUserDetailsKycDetails,\n TransakBuyQuote,\n TransakKycRequirement,\n TransakAdditionalRequirement,\n TransakAdditionalRequirementsResponse,\n TransakOttResponse,\n TransakOrderPaymentMethod,\n TransakDepositOrder,\n TransakDepositNetwork,\n TransakDepositCryptoCurrency,\n TransakDepositPaymentMethod,\n TransakDepositRegion,\n TransakOrder,\n TransakQuoteTranslation,\n TransakTranslationRequest,\n TransakUserLimits,\n TransakIdProofStatus,\n PatchUserRequestBody as TransakPatchUserRequestBody,\n} from './TransakService';\nexport {\n TransakApiError,\n TransakService,\n TransakEnvironment,\n TransakOrderIdTransformer,\n} from './TransakService';\nexport type {\n TransakServiceMethodActions,\n TransakServiceSendUserOtpAction,\n TransakServiceVerifyUserOtpAction,\n TransakServiceGetUserDetailsAction,\n TransakServiceGetBuyQuoteAction,\n TransakServiceGetKycRequirementAction,\n TransakServiceCreateOrderAction,\n TransakServiceGetOrderAction,\n TransakServiceRequestOttAction,\n TransakServiceGeneratePaymentWidgetUrlAction,\n} from './TransakService-method-action-types';\n"]}

@@ -1,2 +0,3 @@

export type { RampsControllerActions, RampsControllerEvents, RampsControllerGetStateAction, RampsControllerSetSelectedTokenAction, RampsControllerGetQuotesAction, RampsControllerGetOrderAction, RampsControllerMessenger, RampsControllerState, RampsControllerStateChangeEvent, RampsControllerOrderStatusChangedEvent, RampsControllerOptions, UserRegion, ResourceState, TransakState, NativeProvidersState, } from "./RampsController.cjs";
export type { RampsControllerActions, RampsControllerEvents, RampsControllerGetStateAction, RampsControllerMessenger, RampsControllerState, RampsControllerStateChangeEvent, RampsControllerOrderStatusChangedEvent, RampsControllerOptions, UserRegion, ResourceState, TransakState, NativeProvidersState, } from "./RampsController.cjs";
export type { RampsControllerExecuteRequestAction, RampsControllerAbortRequestAction, RampsControllerGetRequestStateAction, RampsControllerSetUserRegionAction, RampsControllerSetSelectedProviderAction, RampsControllerInitAction, RampsControllerGetCountriesAction, RampsControllerGetTokensAction, RampsControllerSetSelectedTokenAction, RampsControllerGetProvidersAction, RampsControllerGetPaymentMethodsAction, RampsControllerSetSelectedPaymentMethodAction, RampsControllerGetQuotesAction, RampsControllerAddOrderAction, RampsControllerRemoveOrderAction, RampsControllerStartOrderPollingAction, RampsControllerStopOrderPollingAction, RampsControllerGetBuyWidgetDataAction, RampsControllerAddPrecreatedOrderAction, RampsControllerGetOrderAction, RampsControllerGetOrderFromCallbackAction, RampsControllerTransakSetApiKeyAction, RampsControllerTransakSetAccessTokenAction, RampsControllerTransakClearAccessTokenAction, RampsControllerTransakSetAuthenticatedAction, RampsControllerTransakResetStateAction, RampsControllerTransakSendUserOtpAction, RampsControllerTransakVerifyUserOtpAction, RampsControllerTransakLogoutAction, RampsControllerTransakGetUserDetailsAction, RampsControllerTransakGetBuyQuoteAction, RampsControllerTransakGetKycRequirementAction, RampsControllerTransakGetAdditionalRequirementsAction, RampsControllerTransakCreateOrderAction, RampsControllerTransakGetOrderAction, RampsControllerTransakGetUserLimitsAction, RampsControllerTransakRequestOttAction, RampsControllerTransakGeneratePaymentWidgetUrlAction, RampsControllerTransakSubmitPurposeOfUsageFormAction, RampsControllerTransakPatchUserAction, RampsControllerTransakSubmitSsnDetailsAction, RampsControllerTransakConfirmPaymentAction, RampsControllerTransakGetTranslationAction, RampsControllerTransakGetIdProofStatusAction, RampsControllerTransakCancelOrderAction, RampsControllerTransakCancelAllActiveOrdersAction, RampsControllerTransakGetActiveOrdersAction, } from "./RampsController-method-action-types.cjs";
export { RampsController, getDefaultRampsControllerState, normalizeProviderCode, RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS, } from "./RampsController.cjs";

@@ -3,0 +4,0 @@ export type { RampsServiceActions, RampsServiceEvents, RampsServiceMessenger, Country, State, SupportedActions, CountryPhone, Provider, ProviderLink, ProviderLogos, ProviderBrowserType, RampAction, PaymentMethod, PaymentMethodsResponse, Quote, QuoteError, QuoteSortBy, QuoteSortOrder, QuoteCryptoTranslation, QuoteCustomAction, QuotesResponse, GetQuotesParams, RampsToken, TokensResponse, BuyWidget, RampsOrder, RampsOrderNetwork, RampsOrderCryptoCurrency, RampsOrderFiatCurrency, RampsOrderPaymentMethod, OrderPaymentDetail, } from "./RampsService.cjs";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,E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AAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,qCAAqC,EACrC,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,IAAI,2BAA2B,GACpD,6BAAyB;AAC1B,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,yBAAyB,GAC1B,6BAAyB;AAC1B,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,qCAAqC,EACrC,+BAA+B,EAC/B,4BAA4B,EAC5B,8BAA8B,EAC9B,4CAA4C,GAC7C,iDAA6C"}
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,oBAAoB,GACrB,8BAA0B;AAC3B,YAAY,EACV,mCAAmC,EACnC,iCAAiC,EACjC,oCAAoC,EACpC,kCAAkC,EAClC,wCAAwC,EACxC,yBAAyB,EACzB,iCAAiC,EACjC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,EACjC,sCAAsC,EACtC,6CAA6C,EAC7C,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAChC,sCAAsC,EACtC,qCAAqC,EACrC,qCAAqC,EACrC,uCAAuC,EACvC,6BAA6B,EAC7B,yCAAyC,EACzC,qCAAqC,EACrC,0CAA0C,EAC1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Ac,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,2BAAuB;AACxB,YAAY,EAAE,qBAAqB,EAAE,wBAAoB;AACzD,OAAO,EAAE,qBAAqB,EAAE,wBAAoB;AACpD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,qCAAqC,EACrC,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,IAAI,2BAA2B,GACpD,6BAAyB;AAC1B,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,yBAAyB,GAC1B,6BAAyB;AAC1B,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,qCAAqC,EACrC,+BAA+B,EAC/B,4BAA4B,EAC5B,8BAA8B,EAC9B,4CAA4C,GAC7C,iDAA6C"}

@@ -1,2 +0,3 @@

export type { RampsControllerActions, RampsControllerEvents, RampsControllerGetStateAction, RampsControllerSetSelectedTokenAction, RampsControllerGetQuotesAction, RampsControllerGetOrderAction, RampsControllerMessenger, RampsControllerState, RampsControllerStateChangeEvent, RampsControllerOrderStatusChangedEvent, RampsControllerOptions, UserRegion, ResourceState, TransakState, NativeProvidersState, } from "./RampsController.mjs";
export type { RampsControllerActions, RampsControllerEvents, RampsControllerGetStateAction, RampsControllerMessenger, RampsControllerState, RampsControllerStateChangeEvent, RampsControllerOrderStatusChangedEvent, RampsControllerOptions, UserRegion, ResourceState, TransakState, NativeProvidersState, } from "./RampsController.mjs";
export type { RampsControllerExecuteRequestAction, RampsControllerAbortRequestAction, RampsControllerGetRequestStateAction, RampsControllerSetUserRegionAction, RampsControllerSetSelectedProviderAction, RampsControllerInitAction, RampsControllerGetCountriesAction, RampsControllerGetTokensAction, RampsControllerSetSelectedTokenAction, RampsControllerGetProvidersAction, RampsControllerGetPaymentMethodsAction, RampsControllerSetSelectedPaymentMethodAction, RampsControllerGetQuotesAction, RampsControllerAddOrderAction, RampsControllerRemoveOrderAction, RampsControllerStartOrderPollingAction, RampsControllerStopOrderPollingAction, RampsControllerGetBuyWidgetDataAction, RampsControllerAddPrecreatedOrderAction, RampsControllerGetOrderAction, RampsControllerGetOrderFromCallbackAction, RampsControllerTransakSetApiKeyAction, RampsControllerTransakSetAccessTokenAction, RampsControllerTransakClearAccessTokenAction, RampsControllerTransakSetAuthenticatedAction, RampsControllerTransakResetStateAction, RampsControllerTransakSendUserOtpAction, RampsControllerTransakVerifyUserOtpAction, RampsControllerTransakLogoutAction, RampsControllerTransakGetUserDetailsAction, RampsControllerTransakGetBuyQuoteAction, RampsControllerTransakGetKycRequirementAction, RampsControllerTransakGetAdditionalRequirementsAction, RampsControllerTransakCreateOrderAction, RampsControllerTransakGetOrderAction, RampsControllerTransakGetUserLimitsAction, RampsControllerTransakRequestOttAction, RampsControllerTransakGeneratePaymentWidgetUrlAction, RampsControllerTransakSubmitPurposeOfUsageFormAction, RampsControllerTransakPatchUserAction, RampsControllerTransakSubmitSsnDetailsAction, RampsControllerTransakConfirmPaymentAction, RampsControllerTransakGetTranslationAction, RampsControllerTransakGetIdProofStatusAction, RampsControllerTransakCancelOrderAction, RampsControllerTransakCancelAllActiveOrdersAction, RampsControllerTransakGetActiveOrdersAction, } from "./RampsController-method-action-types.mjs";
export { RampsController, getDefaultRampsControllerState, normalizeProviderCode, RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS, } from "./RampsController.mjs";

@@ -3,0 +4,0 @@ export type { RampsServiceActions, RampsServiceEvents, RampsServiceMessenger, Country, State, SupportedActions, CountryPhone, Provider, ProviderLink, ProviderLogos, ProviderBrowserType, RampAction, PaymentMethod, PaymentMethodsResponse, Quote, QuoteError, QuoteSortBy, QuoteSortOrder, QuoteCryptoTranslation, QuoteCustomAction, QuotesResponse, GetQuotesParams, RampsToken, TokensResponse, BuyWidget, RampsOrder, RampsOrderNetwork, RampsOrderCryptoCurrency, RampsOrderFiatCurrency, RampsOrderPaymentMethod, OrderPaymentDetail, } from "./RampsService.mjs";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,qCAAqC,EACrC,8BAA8B,EAC9B,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,oBAAoB,GACrB,8BAA0B;AAC3B,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,qBAAqB,EACrB,yCAAyC,GAC1C,8BAA0B;AAC3B,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,UAAU,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,GACnB,2BAAuB;AACxB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,2BAAuB;AACxB,YAAY,EACV,gCAAgC,EAChC,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,sCAAsC,GACvC,+CAA2C;AAC5C,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,YAAY,GACb,2BAAuB;AACxB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,2BAAuB;AACxB,YAAY,EAAE,qBAAqB,EAAE,wBAAoB;AACzD,OAAO,EAAE,qBAAqB,EAAE,wBAAoB;AACpD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,qCAAqC,EACrC,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,IAAI,2BAA2B,GACpD,6BAAyB;AAC1B,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,yBAAyB,GAC1B,6BAAyB;AAC1B,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,qCAAqC,EACrC,+BAA+B,EAC/B,4BAA4B,EAC5B,8BAA8B,EAC9B,4CAA4C,GAC7C,iDAA6C"}
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb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oot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,qBAAqB,EACrB,yCAAyC,EAC1C,8BAA0B;AAkC3B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAClB,2BAAuB;AAiBxB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EACjB,2BAAuB;AAExB,OAAO,EAAE,qBAAqB,EAAE,wBAAoB;AA2BpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EAC1B,6BAAyB","sourcesContent":["export type {\n RampsControllerActions,\n RampsControllerEvents,\n RampsControllerGetStateAction,\n RampsControllerSetSelectedTokenAction,\n RampsControllerGetQuotesAction,\n RampsControllerGetOrderAction,\n RampsControllerMessenger,\n RampsControllerState,\n RampsControllerStateChangeEvent,\n RampsControllerOrderStatusChangedEvent,\n RampsControllerOptions,\n UserRegion,\n ResourceState,\n TransakState,\n NativeProvidersState,\n} from './RampsController';\nexport {\n RampsController,\n getDefaultRampsControllerState,\n normalizeProviderCode,\n RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS,\n} from './RampsController';\nexport type {\n RampsServiceActions,\n RampsServiceEvents,\n RampsServiceMessenger,\n Country,\n State,\n SupportedActions,\n CountryPhone,\n Provider,\n ProviderLink,\n ProviderLogos,\n ProviderBrowserType,\n RampAction,\n PaymentMethod,\n PaymentMethodsResponse,\n Quote,\n QuoteError,\n QuoteSortBy,\n QuoteSortOrder,\n QuoteCryptoTranslation,\n QuoteCustomAction,\n QuotesResponse,\n GetQuotesParams,\n RampsToken,\n TokensResponse,\n BuyWidget,\n RampsOrder,\n RampsOrderNetwork,\n RampsOrderCryptoCurrency,\n RampsOrderFiatCurrency,\n RampsOrderPaymentMethod,\n OrderPaymentDetail,\n} from './RampsService';\nexport {\n RampsService,\n RampsEnvironment,\n RampsApiService,\n RampsOrderStatus,\n RAMPS_SDK_VERSION,\n} from './RampsService';\nexport type {\n RampsServiceGetGeolocationAction,\n RampsServiceGetCountriesAction,\n RampsServiceGetPaymentMethodsAction,\n RampsServiceGetQuotesAction,\n RampsServiceGetBuyWidgetUrlAction,\n RampsServiceGetOrderAction,\n RampsServiceGetOrderFromCallbackAction,\n} from './RampsService-method-action-types';\nexport type {\n RequestCache,\n RequestState,\n ExecuteRequestOptions,\n PendingRequest,\n ResourceType,\n} from './RequestCache';\nexport {\n RequestStatus,\n DEFAULT_REQUEST_CACHE_TTL,\n DEFAULT_REQUEST_CACHE_MAX_SIZE,\n createCacheKey,\n isCacheExpired,\n createLoadingState,\n createSuccessState,\n createErrorState,\n} from './RequestCache';\nexport type { RequestSelectorResult } from './selectors';\nexport { createRequestSelector } from './selectors';\nexport type {\n TransakServiceActions,\n TransakServiceEvents,\n TransakServiceMessenger,\n TransakAccessToken,\n TransakUserDetails,\n TransakUserDetailsAddress,\n TransakUserDetailsKycDetails,\n TransakBuyQuote,\n TransakKycRequirement,\n TransakAdditionalRequirement,\n TransakAdditionalRequirementsResponse,\n TransakOttResponse,\n TransakOrderPaymentMethod,\n TransakDepositOrder,\n TransakDepositNetwork,\n TransakDepositCryptoCurrency,\n TransakDepositPaymentMethod,\n TransakDepositRegion,\n TransakOrder,\n TransakQuoteTranslation,\n TransakTranslationRequest,\n TransakUserLimits,\n TransakIdProofStatus,\n PatchUserRequestBody as TransakPatchUserRequestBody,\n} from './TransakService';\nexport {\n TransakApiError,\n TransakService,\n TransakEnvironment,\n TransakOrderIdTransformer,\n} from './TransakService';\nexport type {\n TransakServiceMethodActions,\n TransakServiceSendUserOtpAction,\n TransakServiceVerifyUserOtpAction,\n TransakServiceGetUserDetailsAction,\n TransakServiceGetBuyQuoteAction,\n TransakServiceGetKycRequirementAction,\n TransakServiceCreateOrderAction,\n TransakServiceGetOrderAction,\n TransakServiceRequestOttAction,\n TransakServiceGeneratePaymentWidgetUrlAction,\n} from './TransakService-method-action-types';\n"]}
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+DA,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,qBAAqB,EACrB,yCAAyC,EAC1C,8BAA0B;AAkC3B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAClB,2BAAuB;AAiBxB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EACjB,2BAAuB;AAExB,OAAO,EAAE,qBAAqB,EAAE,wBAAoB;AA2BpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EAC1B,6BAAyB","sourcesContent":["export type {\n RampsControllerActions,\n RampsControllerEvents,\n RampsControllerGetStateAction,\n RampsControllerMessenger,\n RampsControllerState,\n RampsControllerStateChangeEvent,\n RampsControllerOrderStatusChangedEvent,\n RampsControllerOptions,\n UserRegion,\n ResourceState,\n TransakState,\n NativeProvidersState,\n} from './RampsController';\nexport type {\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} from './RampsController-method-action-types';\nexport {\n RampsController,\n getDefaultRampsControllerState,\n normalizeProviderCode,\n RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS,\n} from './RampsController';\nexport type {\n RampsServiceActions,\n RampsServiceEvents,\n RampsServiceMessenger,\n Country,\n State,\n SupportedActions,\n CountryPhone,\n Provider,\n ProviderLink,\n ProviderLogos,\n ProviderBrowserType,\n RampAction,\n PaymentMethod,\n PaymentMethodsResponse,\n Quote,\n QuoteError,\n QuoteSortBy,\n QuoteSortOrder,\n QuoteCryptoTranslation,\n QuoteCustomAction,\n QuotesResponse,\n GetQuotesParams,\n RampsToken,\n TokensResponse,\n BuyWidget,\n RampsOrder,\n RampsOrderNetwork,\n RampsOrderCryptoCurrency,\n RampsOrderFiatCurrency,\n RampsOrderPaymentMethod,\n OrderPaymentDetail,\n} from './RampsService';\nexport {\n RampsService,\n RampsEnvironment,\n RampsApiService,\n RampsOrderStatus,\n RAMPS_SDK_VERSION,\n} from './RampsService';\nexport type {\n RampsServiceGetGeolocationAction,\n RampsServiceGetCountriesAction,\n RampsServiceGetPaymentMethodsAction,\n RampsServiceGetQuotesAction,\n RampsServiceGetBuyWidgetUrlAction,\n RampsServiceGetOrderAction,\n RampsServiceGetOrderFromCallbackAction,\n} from './RampsService-method-action-types';\nexport type {\n RequestCache,\n RequestState,\n ExecuteRequestOptions,\n PendingRequest,\n ResourceType,\n} from './RequestCache';\nexport {\n RequestStatus,\n DEFAULT_REQUEST_CACHE_TTL,\n DEFAULT_REQUEST_CACHE_MAX_SIZE,\n createCacheKey,\n isCacheExpired,\n createLoadingState,\n createSuccessState,\n createErrorState,\n} from './RequestCache';\nexport type { RequestSelectorResult } from './selectors';\nexport { createRequestSelector } from './selectors';\nexport type {\n TransakServiceActions,\n TransakServiceEvents,\n TransakServiceMessenger,\n TransakAccessToken,\n TransakUserDetails,\n TransakUserDetailsAddress,\n TransakUserDetailsKycDetails,\n TransakBuyQuote,\n TransakKycRequirement,\n TransakAdditionalRequirement,\n TransakAdditionalRequirementsResponse,\n TransakOttResponse,\n TransakOrderPaymentMethod,\n TransakDepositOrder,\n TransakDepositNetwork,\n TransakDepositCryptoCurrency,\n TransakDepositPaymentMethod,\n TransakDepositRegion,\n TransakOrder,\n TransakQuoteTranslation,\n TransakTranslationRequest,\n TransakUserLimits,\n TransakIdProofStatus,\n PatchUserRequestBody as TransakPatchUserRequestBody,\n} from './TransakService';\nexport {\n TransakApiError,\n TransakService,\n TransakEnvironment,\n TransakOrderIdTransformer,\n} from './TransakService';\nexport type {\n TransakServiceMethodActions,\n TransakServiceSendUserOtpAction,\n TransakServiceVerifyUserOtpAction,\n TransakServiceGetUserDetailsAction,\n TransakServiceGetBuyQuoteAction,\n TransakServiceGetKycRequirementAction,\n TransakServiceCreateOrderAction,\n TransakServiceGetOrderAction,\n TransakServiceRequestOttAction,\n TransakServiceGeneratePaymentWidgetUrlAction,\n} from './TransakService-method-action-types';\n"]}
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
import { BaseController } from "@metamask/base-controller";
import type { Messenger } from "@metamask/messenger";
import type { RampsControllerMethodActions } from "./RampsController-method-action-types.cjs";
import type { BuyWidget, Country, TokensResponse, Provider, State, RampAction, PaymentMethod, PaymentMethodsResponse, QuotesResponse, Quote, RampsToken, RampsServiceActions, RampsOrder } from "./RampsService.cjs";

@@ -141,26 +142,5 @@ import { RampsOrderStatus } from "./RampsService.cjs";

/**
* Sets selected token in the {@link RampsController}.
*/
export type RampsControllerSetSelectedTokenAction = {
type: 'RampsController:setSelectedToken';
handler: RampsController['setSelectedToken'];
};
/**
* Fetches quotes via the {@link RampsController}.
*/
export type RampsControllerGetQuotesAction = {
type: 'RampsController:getQuotes';
handler: RampsController['getQuotes'];
};
/**
* Fetches an order via the {@link RampsController}.
*/
export type RampsControllerGetOrderAction = {
type: 'RampsController:getOrder';
handler: RampsController['getOrder'];
};
/**
* Actions that {@link RampsControllerMessenger} exposes to other consumers.
*/
export type RampsControllerActions = RampsControllerGetStateAction | RampsControllerGetOrderAction | RampsControllerGetQuotesAction | RampsControllerSetSelectedTokenAction;
export type RampsControllerActions = RampsControllerGetStateAction | RampsControllerMethodActions;
/**

@@ -167,0 +147,0 @@ * Actions from other messengers that {@link RampsController} calls.

@@ -1,1 +0,1 @@

{"version":3,"file":"RampsController.d.cts","sourceRoot":"","sources":["../src/RampsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAIrD,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,KAAK,EACL,UAAU,EACV,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,KAA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G;IACG,qBAAqB,CACzB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAahC;;;;;OAKG;IACG,qBAAqB,CACzB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,uBAAuB,CAAC;IAInC;;;;;OAKG;IACG,uBAAuB,CAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,oBAAoB,CAAC;IAYhC;;;;;OAKG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/D;;;;;OAKG;IACG,4BAA4B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAStD;;;;OAIG;IACG,sBAAsB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;CAQxD"}
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
import { BaseController } from "@metamask/base-controller";
import type { Messenger } from "@metamask/messenger";
import type { RampsControllerMethodActions } from "./RampsController-method-action-types.mjs";
import type { BuyWidget, Country, TokensResponse, Provider, State, RampAction, PaymentMethod, PaymentMethodsResponse, QuotesResponse, Quote, RampsToken, RampsServiceActions, RampsOrder } from "./RampsService.mjs";

@@ -141,26 +142,5 @@ import { RampsOrderStatus } from "./RampsService.mjs";

/**
* Sets selected token in the {@link RampsController}.
*/
export type RampsControllerSetSelectedTokenAction = {
type: 'RampsController:setSelectedToken';
handler: RampsController['setSelectedToken'];
};
/**
* Fetches quotes via the {@link RampsController}.
*/
export type RampsControllerGetQuotesAction = {
type: 'RampsController:getQuotes';
handler: RampsController['getQuotes'];
};
/**
* Fetches an order via the {@link RampsController}.
*/
export type RampsControllerGetOrderAction = {
type: 'RampsController:getOrder';
handler: RampsController['getOrder'];
};
/**
* Actions that {@link RampsControllerMessenger} exposes to other consumers.
*/
export type RampsControllerActions = RampsControllerGetStateAction | RampsControllerGetOrderAction | RampsControllerGetQuotesAction | RampsControllerSetSelectedTokenAction;
export type RampsControllerActions = RampsControllerGetStateAction | RampsControllerMethodActions;
/**

@@ -167,0 +147,0 @@ * Actions from other messengers that {@link RampsController} calls.

@@ -1,1 +0,1 @@

{"version":3,"file":"RampsController.d.mts","sourceRoot":"","sources":["../src/RampsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAIrD,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,KAAK,EACL,UAAU,EACV,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,UAAU,EACX,2BAAuB;AACxB,OAAO,EAAE,gBAAgB,EAAE,2BAAuB;AAClD,OAAO,KAAK,EACV,gCAAgC,EAChC,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,sCAAsC,EACvC,+CAA2C;AAC5C,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,YAAY,EACZ,qBAAqB,EAGtB,2BAAuB;AAWxB,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qCAAqC,EACrC,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACb,6BAAyB;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAC9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,iCAAiC,EACjC,0BAA0B,EAC1B,kCAAkC,EAClC,+BAA+B,E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CAAC;IAY/D;;;;;OAKG;IACG,4BAA4B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAStD;;;;OAIG;IACG,sBAAsB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;CAQxD"}
{"version":3,"file":"RampsController.d.mts","sourceRoot":"","sources":["../src/RampsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAIrD,OAAO,KAAK,EAAE,4BAA4B,EAAE,kDAA8C;AAC1F,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,KAAK,EACL,UAAU,EACV,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,KAAK,EACL,UAAU,EACV,mBAAmB,EACnB,UAAU,EACX,2BAAuB;AACxB,OAAO,EAAE,gBAAgB,EAAE,2BAAuB;AAClD,OAAO,KAAK,EACV,gCAAgC,EAChC,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,sCAAsC,EACvC,+CAA2C;AAC5C,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,YAAY,EACZ,qBAAqB,EAGtB,2BAAuB;AAWxB,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qCAAqC,EACrC,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACb,6BAAyB;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAAyB;AAC9D,OAAO,KAAK,EACV,6BAA6B,EAC7B,kCAAkC,EAClC,oCAAoC,EACpC,+B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;;;OAQG;IACH,+BAA+B,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,MAAM;IAUT;;;;;OAKG;IACG,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvE;;;;;OAKG;IACG,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IASpE;;;;;;OAMG;IACG,uBAAuB,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC;IAanB;;;;;;OAMG;IACG,qBAAqB,CACzB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAahC;;;;;OAKG;IACG,qBAAqB,CACzB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,uBAAuB,CAAC;IAInC;;;;;OAKG;IACG,uBAAuB,CAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,oBAAoB,CAAC;IAYhC;;;;;OAKG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/D;;;;;OAKG;IACG,4BAA4B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAStD;;;;OAIG;IACG,sBAAsB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;CAQxD"}

@@ -505,3 +505,5 @@ "use strict";

__classPrivateFieldGet(this, _RampsService_instances, "m", _RampsService_addCommonParams).call(this, url);
url.searchParams.set('wallet', wallet);
if (wallet) {
url.searchParams.set('wallet', wallet);
}
const response = await __classPrivateFieldGet(this, _RampsService_policy, "f").execute(async () => {

@@ -508,0 +510,0 @@ const fetchResponse = await __classPrivateFieldGet(this, _RampsService_fetch, "f").call(this, url);

@@ -1,1 +0,1 @@

{"version":3,"file":"RampsService.cjs","sourceRoot":"","sources":["../src/RampsService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,iEAA4E;AAI5E,mEAA0C;AAwe1C,sBAAsB;AAEtB;;GAEG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,4CAAwB,CAAA;AAC1B,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B;AA8FD;;GAEG;AACU,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAOzC,kBAAkB;AAElB;;;GAGG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;IAC3B,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,oBAAoB;AAEpB,MAAM,yBAAyB,GAAG;IAChC,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,UAAU;IACV,sBAAsB;CACd,CAAC;AAgCX,6BAA6B;AAE7B;;;;;;;GAOG;AACH,SAAS,UAAU,CACjB,WAA6B,EAC7B,OAAwB;IAExB,MAAM,KAAK,GAAG,OAAO,KAAK,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAElE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AC;IACxD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,uBAAA,IAAI,6BAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,gCACH,OAAwB,EACxB,IAAY,EACZ,OAGC;IAED,OAAO,uBAAA,IAAI,4BAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAA,IAAI,yDAAY,MAAhB,IAAI,EAAa,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,uBAAA,IAAI,8DAAiB,MAArB,IAAI,EAAkB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,2BAAO,MAAX,IAAI,EAAQ,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,4BAAS,CACjB,QAAQ,CAAC,MAAM,EACf,aAAa,GAAG,CAAC,QAAQ,EAAE,yBAAyB,QAAQ,CAAC,MAAM,GAAG,CACvE,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC,YAAY,KAAK,MAAM;YACpC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB;YACzC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport { createServicePolicy, HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\n\nimport type { RampsServiceMethodActions } from './RampsService-method-action-types';\nimport packageJson from '../package.json';\n\n/**\n * Represents phone number information for a country.\n */\nexport type CountryPhone = {\n prefix: string;\n placeholder: string;\n template: string;\n};\n\n/**\n * Indicates whether a region supports buy and/or sell actions.\n */\nexport type SupportedActions = {\n /**\n * Whether buy actions are supported.\n */\n buy: boolean;\n /**\n * Whether sell actions are supported.\n */\n sell: boolean;\n};\n\n/**\n * Represents a state/province within a country.\n */\nexport type State = {\n /**\n * State identifier. Can be in path format (e.g., \"/regions/us-ut\") or ISO code format (e.g., \"us-ut\").\n */\n id?: string;\n /**\n * State name.\n */\n name?: string;\n /**\n * ISO state code (e.g., \"UT\", \"NY\").\n */\n stateId?: string;\n /**\n * Whether this state is supported for buy and/or sell ramp actions.\n */\n supported?: SupportedActions;\n /**\n * Whether this state is recommended.\n */\n recommended?: boolean;\n};\n\n/**\n * Represents a provider link.\n */\nexport type ProviderLink = {\n name: string;\n url: string;\n};\n\n/**\n * Represents provider logos.\n */\nexport type ProviderLogos = {\n light: string;\n dark: string;\n height: number;\n width: number;\n};\n\n/**\n * Browser type for provider buy features.\n */\nexport type ProviderBrowserType = 'APP_BROWSER' | 'IN_APP_OS_BROWSER' | null;\n\n/**\n * Represents a ramp provider.\n */\nexport type Provider = {\n id: string;\n name: string;\n environmentType: string;\n description: string;\n hqAddress: string;\n links: ProviderLink[];\n logos: ProviderLogos;\n supportedCryptoCurrencies?: Record<string, boolean>;\n supportedFiatCurrencies?: Record<string, boolean>;\n supportedPaymentMethods?: Record<string, boolean>;\n};\n\n/**\n * Represents a payment method for funding a purchase.\n */\nexport type PaymentMethod = {\n /**\n * Canonical payment method ID (e.g., \"/payments/debit-credit-card\").\n */\n id: string;\n /**\n * Payment type identifier (e.g., \"debit-credit-card\", \"bank-transfer\").\n */\n paymentType: string;\n /**\n * User-facing name for the payment method.\n */\n name: string;\n /**\n * Score for sorting payment methods (higher is better).\n */\n score: number;\n /**\n * Icon identifier for the payment method.\n */\n icon: string;\n /**\n * Localized disclaimer text (optional).\n */\n disclaimer?: string;\n /**\n * Delay in minutes (e.g., [5, 10]).\n */\n delay?: number[];\n /**\n * Localized pending order description (optional).\n */\n pendingOrderDescription?: string;\n /**\n * Whether this payment method is a manual bank transfer.\n */\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Response from the paymentMethods API.\n */\nexport type PaymentMethodsResponse = {\n /**\n * List of available payment methods.\n */\n payments: PaymentMethod[];\n /**\n * Recommended sorting for payment methods.\n */\n sort?: {\n ids: string[];\n sortBy: string;\n };\n};\n\n// === QUOTES TYPES ===\n\n/**\n * Sort criteria for quotes.\n */\nexport type QuoteSortBy = 'price' | 'reliability';\n\n/**\n * Represents crypto translation info for a quote.\n */\nexport type QuoteCryptoTranslation = {\n /**\n * The crypto currency ID.\n */\n id?: string;\n /**\n * The crypto symbol.\n */\n symbol?: string;\n /**\n * The chain ID.\n */\n chainId?: string;\n};\n\n/**\n * Widget information for executing a buy order.\n */\nexport type BuyWidget = {\n /**\n * The widget URL to open for the user to complete the purchase.\n */\n url: string;\n /**\n * The browser type to use for opening the widget.\n */\n browser?: ProviderBrowserType;\n /**\n * Order ID if already created.\n */\n orderId?: string | null;\n};\n\n/**\n * Represents an individual quote from a provider.\n */\nexport type Quote = {\n /**\n * The provider ID (e.g., \"/providers/moonpay\").\n */\n provider: string;\n /**\n * The quote details.\n */\n quote: {\n /**\n * The amount the user is paying (in fiat for buy, crypto for sell).\n */\n amountIn: number | string;\n /**\n * The amount the user will receive (in crypto for buy, fiat for sell).\n */\n amountOut: number | string;\n /**\n * The payment method used for this quote.\n */\n paymentMethod: string;\n /**\n * The fiat value of the output amount (for buy actions).\n */\n amountOutInFiat?: number;\n /**\n * Crypto translation info for display.\n */\n cryptoTranslation?: QuoteCryptoTranslation;\n /**\n * Total fees in the source currency.\n */\n totalFees?: number | string;\n /**\n * Network fees.\n */\n networkFee?: number | string;\n /**\n * Provider fees.\n */\n providerFee?: number | string;\n /**\n * Buy URL endpoint that returns the actual provider widget URL.\n *\n * This is a MetaMask-hosted endpoint that, when fetched, returns JSON with the provider's widget URL.\n *\n * @deprecated Use buyWidget instead - it's embedded in the quote response.\n */\n buyURL?: string;\n /**\n * Widget information embedded in the quote response.\n * Contains the widget URL, browser type, and optional pre-order tracking ID.\n */\n buyWidget?: BuyWidget;\n };\n /**\n * Metadata about the quote.\n */\n metadata?: {\n /**\n * Reliability score for the provider (0-100).\n */\n reliability?: number;\n /**\n * Tags for the quote.\n */\n tags?: {\n /**\n * Whether this is the best rate quote.\n */\n isBestRate?: boolean;\n /**\n * Whether this is the most reliable provider.\n */\n isMostReliable?: boolean;\n };\n };\n};\n\n/**\n * Represents an error from a provider when fetching quotes.\n */\nexport type QuoteError = {\n /**\n * The provider ID that failed.\n */\n provider: string;\n /**\n * Error message.\n */\n error?: string;\n};\n\n/**\n * Sort order information for quotes.\n */\nexport type QuoteSortOrder = {\n /**\n * The sort criteria.\n */\n sortBy: QuoteSortBy;\n /**\n * Provider IDs in sorted order.\n */\n ids: string[];\n};\n\n/**\n * Custom action for a provider (e.g., Apple Pay).\n */\nexport type QuoteCustomAction = {\n /**\n * Buy action details.\n */\n buy: {\n /**\n * Provider ID.\n */\n providerId: string;\n };\n /**\n * Payment method ID this action applies to.\n */\n paymentMethodId: string;\n /**\n * Supported payment method IDs.\n */\n supportedPaymentMethodIds: string[];\n};\n\n/**\n * Response from the quotes API.\n */\nexport type QuotesResponse = {\n /**\n * Successfully retrieved quotes.\n */\n success: Quote[];\n /**\n * Sort orders for the quotes.\n */\n sorted: QuoteSortOrder[];\n /**\n * Errors from providers that failed to return quotes.\n */\n error: QuoteError[];\n /**\n * Custom actions available from providers.\n */\n customActions: QuoteCustomAction[];\n};\n\n/**\n * Parameters for fetching quotes.\n */\nexport type GetQuotesParams = {\n /**\n * The region code (e.g., \"us\", \"us-ca\").\n */\n region: string;\n /**\n * Array of payment method IDs to get quotes for.\n */\n paymentMethods: string[];\n /**\n * The CAIP-19 asset ID (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The fiat currency code (e.g., \"usd\").\n */\n fiat: string;\n /**\n * The amount (in fiat for buy, crypto for sell).\n */\n amount: number;\n /**\n * The destination wallet address.\n */\n walletAddress: string;\n /**\n * Optional redirect URL after order completion.\n */\n redirectUrl?: string;\n /**\n * Optional provider IDs to filter quotes.\n */\n providers?: string[];\n /**\n * The ramp action type. Defaults to 'buy'.\n */\n action?: RampAction;\n};\n\n/**\n * Represents a country returned from the regions/countries API.\n */\nexport type Country = {\n /**\n * ISO-2 country code (e.g., \"US\", \"GB\").\n */\n isoCode: string;\n /**\n * Country identifier. Can be in path format (e.g., \"/regions/us\") or ISO code format.\n * If not provided, defaults to isoCode.\n */\n id?: string;\n /**\n * Country flag emoji or code.\n */\n flag: string;\n /**\n * Country name.\n */\n name: string;\n /**\n * Phone number information.\n */\n phone: CountryPhone;\n /**\n * Default currency code.\n */\n currency: string;\n /**\n * Whether this country is supported for buy and/or sell ramp actions.\n */\n supported: SupportedActions;\n /**\n * Whether this country is recommended.\n */\n recommended?: boolean;\n /**\n * Array of state objects.\n */\n states?: State[];\n /**\n * Default amount for ramps transactions.\n */\n defaultAmount?: number;\n /**\n * Quick amount options for ramps transactions.\n */\n quickAmounts?: number[];\n};\n\n/**\n * Represents a token returned from the regions/{region}/tokens API.\n */\nexport type RampsToken = {\n /**\n * The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The chain identifier in CAIP-2 format (e.g., \"eip155:1\").\n */\n chainId: string;\n /**\n * Token name (e.g., \"USD Coin\").\n */\n name: string;\n /**\n * Token symbol (e.g., \"USDC\").\n */\n symbol: string;\n /**\n * Number of decimals for the token.\n */\n decimals: number;\n /**\n * URL to the token icon.\n */\n iconUrl: string;\n /**\n * Whether this token is supported.\n */\n tokenSupported: boolean;\n};\n\n/**\n * Response from the regions/{region}/tokens API.\n */\nexport type TokensResponse = {\n /**\n * Top/popular tokens for the region.\n */\n topTokens: RampsToken[];\n /**\n * All available tokens for the region.\n */\n allTokens: RampsToken[];\n};\n\n// === ORDER TYPES ===\n\n/**\n * Possible statuses for a ramps order.\n */\nexport enum RampsOrderStatus {\n Unknown = 'UNKNOWN',\n Precreated = 'PRECREATED',\n Created = 'CREATED',\n Pending = 'PENDING',\n Failed = 'FAILED',\n Completed = 'COMPLETED',\n Cancelled = 'CANCELLED',\n IdExpired = 'ID_EXPIRED',\n}\n\n/**\n * Network information associated with an order.\n */\nexport type RampsOrderNetwork = {\n name: string;\n chainId: string;\n};\n\n/**\n * Crypto currency information associated with an order.\n */\nexport type RampsOrderCryptoCurrency = {\n assetId?: string;\n name?: string;\n chainId?: string;\n decimals?: number;\n iconUrl?: string;\n symbol: string;\n};\n\n/**\n * Payment method information associated with an order.\n */\nexport type RampsOrderPaymentMethod = {\n id: string;\n name?: string;\n shortName?: string;\n duration?: string;\n icon?: string;\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Bank transfer instruction fields attached to an order by providers\n * that require manual payment (e.g. SEPA, wire transfer).\n */\nexport type OrderPaymentDetail = {\n fiatCurrency: string;\n paymentMethod: string;\n fields: { name: string; id: string; value: string }[];\n};\n\n/**\n * Fiat currency information associated with an order.\n */\nexport type RampsOrderFiatCurrency = {\n id?: string;\n symbol: string;\n name?: string;\n decimals?: number;\n denomSymbol?: string;\n};\n\n/**\n * A unified order type returned from the V2 API.\n * The V2 endpoint normalizes all provider responses into this shape.\n */\nexport type RampsOrder = {\n id?: string;\n isOnlyLink: boolean;\n provider?: Provider;\n success: boolean;\n cryptoAmount: string | number;\n fiatAmount: number;\n cryptoCurrency?: RampsOrderCryptoCurrency;\n fiatCurrency?: RampsOrderFiatCurrency;\n providerOrderId: string;\n providerOrderLink: string;\n createdAt: number;\n paymentMethod?: RampsOrderPaymentMethod;\n totalFeesFiat: number;\n txHash: string;\n walletAddress: string;\n status: RampsOrderStatus;\n network: RampsOrderNetwork;\n canBeUpdated: boolean;\n idHasExpired: boolean;\n idExpirationDate?: number;\n excludeFromPurchases: boolean;\n timeDescriptionPending: string;\n fiatAmountInUsd?: number;\n feesInUsd?: number;\n region?: string;\n orderType: string;\n exchangeRate?: number;\n pollingSecondsMinimum?: number;\n statusDescription?: string;\n partnerFees?: number;\n networkFees?: number;\n paymentDetails?: OrderPaymentDetail[];\n};\n\n/**\n * The SDK version to send with API requests. (backwards-compatibility)\n */\nexport const RAMPS_SDK_VERSION = '2.1.6';\n\n/**\n * The type of ramp action: 'buy' or 'sell'.\n */\nexport type RampAction = 'buy' | 'sell';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link RampsService}, used to namespace the\n * service's actions and events.\n */\nexport const serviceName = 'RampsService';\n\n/**\n * The environment to use for API requests.\n */\nexport enum RampsEnvironment {\n Production = 'production',\n Staging = 'staging',\n Development = 'development',\n Local = 'local',\n}\n\n/**\n * The type of ramps API service.\n * Determines which base URL to use (cache vs standard).\n */\nexport enum RampsApiService {\n Regions = 'regions',\n Orders = 'orders',\n}\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getGeolocation',\n 'getCountries',\n 'getTokens',\n 'getProviders',\n 'getPaymentMethods',\n 'getQuotes',\n 'getBuyWidgetUrl',\n 'getOrder',\n 'getOrderFromCallback',\n] as const;\n\n/**\n * Actions that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceActions = RampsServiceMethodActions;\n\n/**\n * Actions from other messengers that {@link RampsService} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Events that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceEvents = never;\n\n/**\n * Events from other messengers that {@link RampsService} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link RampsService}.\n */\nexport type RampsServiceMessenger = Messenger<\n typeof serviceName,\n RampsServiceActions | AllowedActions,\n RampsServiceEvents | AllowedEvents\n>;\n\n// === SERVICE DEFINITION ===\n\n/**\n * Gets the base URL for API requests based on the environment and service type.\n * The Regions service uses a cache URL, while other services use the standard URL.\n *\n * @param environment - The environment to use.\n * @param service - The API service type (determines if cache URL is used).\n * @returns The base URL for API requests.\n */\nfunction getBaseUrl(\n environment: RampsEnvironment,\n service: RampsApiService,\n): string {\n const cache = service === RampsApiService.Regions ? '-cache' : '';\n\n switch (environment) {\n case RampsEnvironment.Production:\n return `https://on-ramp${cache}.api.cx.metamask.io`;\n case RampsEnvironment.Staging:\n case RampsEnvironment.Development:\n return `https://on-ramp${cache}.uat-api.cx.metamask.io`;\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Constructs an API path with a version prefix.\n *\n * @param path - The API endpoint path.\n * @param version - The API version prefix. Defaults to 'v2'.\n * @returns The versioned API path.\n */\nfunction getApiPath(path: string, version: string = 'v2'): string {\n return `${version}/${path}`;\n}\n\n/**\n * This service object is responsible for interacting with the Ramps API.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * RampsServiceActions,\n * RampsServiceEvents,\n * } from '@metamask/ramps-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * RampsServiceActions\n * RampsServiceEvents\n * >({ namespace: 'Root' });\n * const rampsServiceMessenger = new Messenger<\n * 'RampsService',\n * RampsServiceActions,\n * RampsServiceEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'RampsService',\n * parent: rootMessenger,\n * });\n * // Instantiate the service to register its actions on the messenger\n * new RampsService({\n * messenger: rampsServiceMessenger,\n * environment: RampsEnvironment.Production,\n * context: 'mobile-ios',\n * fetch,\n * });\n *\n * // Later...\n * // Get the user's geolocation\n * const geolocation = await rootMessenger.call(\n * 'RampsService:getGeolocation',\n * );\n * // ... Do something with the geolocation ...\n * ```\n */\nexport class RampsService {\n /**\n * The name of the service.\n */\n readonly name: typeof serviceName;\n\n /**\n * The messenger suited for this service.\n */\n readonly #messenger: ConstructorParameters<\n typeof RampsService\n >[0]['messenger'];\n\n /**\n * A function that can be used to make an HTTP request.\n */\n readonly #fetch: ConstructorParameters<typeof RampsService>[0]['fetch'];\n\n /**\n * The policy that wraps the request.\n *\n * @see {@link createServicePolicy}\n */\n readonly #policy: ServicePolicy;\n\n /**\n * The environment used for API requests.\n */\n readonly #environment: RampsEnvironment;\n\n /**\n * The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n */\n readonly #context: string;\n\n /**\n * Optional base URL override for local development.\n */\n readonly #baseUrlOverride?: string;\n\n /**\n * Constructs a new RampsService object.\n *\n * @param args - The constructor arguments.\n * @param args.messenger - The messenger suited for this service.\n * @param args.environment - The environment to use for API requests.\n * @param args.context - The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n * @param args.fetch - A function that can be used to make an HTTP request. If\n * your JavaScript environment supports `fetch` natively, you'll probably want\n * to pass that; otherwise you can pass an equivalent (such as `fetch` via\n * `node-fetch`).\n * @param args.policyOptions - Options to pass to `createServicePolicy`, which\n * is used to wrap each request. See {@link CreateServicePolicyOptions}.\n * @param args.baseUrlOverride - Optional base URL override for local development.\n */\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: RampsServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy(policyOptions);\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Gets the base URL for API requests, respecting the baseUrlOverride if set.\n *\n * @param service - The API service type.\n * @returns The base URL to use.\n */\n #getBaseUrl(service: RampsApiService): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment, service);\n }\n\n /**\n * Registers a handler that will be called after a request returns a non-500\n * response, causing a retry. Primarily useful in tests where timers are being\n * mocked.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n /**\n * Registers a handler that will be called after a set number of retry rounds\n * prove that requests to the API endpoint consistently return a 5xx response.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n /**\n * Registers a handler that will be called under one of two circumstances:\n *\n * 1. After a set number of retries prove that requests to the API\n * consistently result in one of the following failures:\n * 1. A connection initiation error\n * 2. A connection reset error\n * 3. A timeout error\n * 4. A non-JSON response\n * 5. A 502, 503, or 504 response\n * 2. After a successful request is made to the API, but the response takes\n * longer than a set duration to return.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n */\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n\n /**\n * Adds common request parameters to a URL.\n *\n * @param url - The URL to add parameters to.\n * @param action - The ramp action type (optional, not all endpoints require it).\n */\n #addCommonParams(url: URL, action?: RampAction): void {\n if (action) {\n url.searchParams.set('action', action);\n }\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n }\n\n /**\n * Makes an API request with retry policy and error handling.\n *\n * @param service - The API service type (determines base URL).\n * @param path - The endpoint path.\n * @param options - Request options.\n * @param options.action - The ramp action type (optional).\n * @param options.responseType - How to parse the response ('json' or 'text').\n * @returns The parsed response data.\n */\n async #request<TResponse>(\n service: RampsApiService,\n path: string,\n options: {\n action?: RampAction;\n responseType: 'json' | 'text';\n },\n ): Promise<TResponse> {\n return this.#policy.execute(async () => {\n const baseUrl = this.#getBaseUrl(service);\n const url = new URL(path, baseUrl);\n this.#addCommonParams(url, options.action);\n\n const response = await this.#fetch(url);\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'`,\n );\n }\n\n return options.responseType === 'json'\n ? (response.json() as Promise<TResponse>)\n : (response.text() as Promise<TResponse>);\n });\n }\n\n /**\n * Makes a request to the API in order to retrieve the user's geolocation\n * based on their IP address.\n *\n * @returns The user's country/region code (e.g., \"US-UT\" for Utah, USA).\n */\n async getGeolocation(): Promise<string> {\n const textResponse = await this.#request<string>(\n RampsApiService.Orders,\n 'geolocation',\n { responseType: 'text' },\n );\n\n const trimmedResponse = textResponse.trim();\n if (trimmedResponse.length > 0) {\n return trimmedResponse;\n }\n\n throw new Error('Malformed response received from geolocation API');\n }\n\n /**\n * Makes a request to the cached API to retrieve the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * Filters countries based on aggregator support (preserves OnRampSDK logic).\n *\n * @returns An array of countries filtered by aggregator support.\n */\n async getCountries(): Promise<Country[]> {\n const countries = await this.#request<Country[]>(\n RampsApiService.Regions,\n getApiPath('regions/countries'),\n { responseType: 'json' },\n );\n\n if (!Array.isArray(countries)) {\n throw new Error('Malformed response received from countries API');\n }\n\n return countries.filter((country) => {\n const isCountrySupported =\n country.supported.buy || country.supported.sell;\n\n if (country.states && country.states.length > 0) {\n const hasSupportedState = country.states.some(\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentionally using || to treat false as unsupported\n (state) => state.supported?.buy || state.supported?.sell,\n );\n return isCountrySupported || hasSupportedState;\n }\n\n return isCountrySupported;\n });\n }\n\n /**\n * Fetches the list of available tokens for a given region and action.\n * Supports optional provider filter.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Optional query parameters for filtering tokens.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\n async getTokens(\n region: string,\n action: RampAction = 'buy',\n options?: {\n provider?: string | string[];\n },\n ): Promise<TokensResponse> {\n const normalizedRegion = region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/topTokens`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url, action);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<TokensResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from tokens API');\n }\n\n if (\n !Array.isArray(response.topTokens) ||\n !Array.isArray(response.allTokens)\n ) {\n throw new Error('Malformed response received from tokens API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of providers for a given region.\n * Supports optional query filters: provider, crypto, fiat, payments.\n *\n * @param regionCode - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param options - Optional query parameters for filtering providers.\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 */\n async getProviders(\n regionCode: string,\n options?: {\n provider?: string | string[];\n crypto?: string | string[];\n fiat?: string | string[];\n payments?: string | string[];\n },\n ): Promise<{ providers: Provider[] }> {\n const normalizedRegion = regionCode.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/providers`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n if (options?.crypto) {\n const cryptoIds = Array.isArray(options.crypto)\n ? options.crypto\n : [options.crypto];\n cryptoIds.forEach((id) => url.searchParams.append('crypto', id));\n }\n\n if (options?.fiat) {\n const fiatIds = Array.isArray(options.fiat)\n ? options.fiat\n : [options.fiat];\n fiatIds.forEach((id) => url.searchParams.append('fiat', id));\n }\n\n if (options?.payments) {\n const paymentIds = Array.isArray(options.payments)\n ? options.payments\n : [options.payments];\n paymentIds.forEach((id) => url.searchParams.append('payments', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ providers: Provider[] }>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from providers API');\n }\n\n if (!Array.isArray(response.providers)) {\n throw new Error('Malformed response received from providers API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of payment methods for a given region, asset, and provider.\n *\n * @param options - Query parameters for filtering payment methods.\n * @param options.region - User's region code (e.g., \"us-al\").\n * @param options.fiat - Fiat currency code (e.g., \"usd\").\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 */\n async getPaymentMethods(options: {\n region: string;\n fiat: string;\n assetId: string;\n provider: string;\n }): Promise<PaymentMethodsResponse> {\n const normalizedRegion = options.region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/payments`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n url.searchParams.set('region', options.region.toLowerCase().trim());\n url.searchParams.set('fiat', options.fiat.toLowerCase().trim());\n url.searchParams.set('crypto', options.assetId);\n url.searchParams.set('provider', options.provider);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<PaymentMethodsResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n if (!Array.isArray(response.payments)) {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n return response;\n }\n\n /**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the V2 orders API to get quotes for multiple payment methods at once.\n *\n * @param params - The parameters for fetching quotes.\n * @param params.region - User's region code (e.g., \"us\", \"us-ca\").\n * @param params.paymentMethods - Array of payment method IDs.\n * @param params.assetId - CAIP-19 cryptocurrency identifier.\n * @param params.fiat - Fiat currency code (e.g., \"usd\").\n * @param params.amount - The amount (in fiat for buy, crypto for sell).\n * @param params.walletAddress - The destination wallet address.\n * @param params.redirectUrl - Optional redirect URL after order completion.\n * @param params.providers - Optional provider IDs to filter quotes.\n * @param params.action - The ramp action type. Defaults to 'buy'.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\n async getQuotes(params: GetQuotesParams): Promise<QuotesResponse> {\n const normalizedRegion = params.region.toLowerCase().trim();\n const normalizedFiat = params.fiat.toLowerCase().trim();\n const action = params.action ?? 'buy';\n\n const url = new URL(\n getApiPath('quotes'),\n getBaseUrl(this.#environment, RampsApiService.Orders),\n );\n this.#addCommonParams(url, action);\n\n // Build region ID in the format expected by the API\n url.searchParams.set('region', normalizedRegion);\n url.searchParams.set('fiat', normalizedFiat);\n url.searchParams.set('crypto', params.assetId);\n url.searchParams.set('amount', String(params.amount));\n url.searchParams.set('walletAddress', params.walletAddress);\n\n // Add payment methods as array parameters\n params.paymentMethods.forEach((paymentMethod) => {\n url.searchParams.append('payments', paymentMethod);\n });\n\n // Add provider filter if specified\n params.providers?.forEach((provider) => {\n url.searchParams.append('providers', provider);\n });\n\n // Add redirect URL if specified\n if (params.redirectUrl) {\n url.searchParams.set('redirectUrl', params.redirectUrl);\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<QuotesResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from quotes API');\n }\n\n if (\n !Array.isArray(response.success) ||\n !Array.isArray(response.sorted) ||\n !Array.isArray(response.error) ||\n !Array.isArray(response.customActions)\n ) {\n throw new Error('Malformed response received from quotes API');\n }\n\n return response;\n }\n\n /**\n * Fetches the buy widget data from a buy URL endpoint.\n * Makes a request to the buyURL (as provided in a quote) to get the actual\n * provider widget URL, browser type, and order ID.\n *\n * @param buyUrl - The full buy URL endpoint to fetch from.\n * @returns The buy widget data containing the provider widget URL.\n */\n async getBuyWidgetUrl(buyUrl: string): Promise<BuyWidget> {\n const url = new URL(buyUrl);\n this.#addCommonParams(url);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<BuyWidget>;\n });\n\n if (!response || typeof response !== 'object' || !response.url) {\n throw new Error('Malformed response received from buy widget URL API');\n }\n\n return response;\n }\n\n /**\n * Fetches an order from the unified V2 API endpoint.\n * This endpoint returns a normalized `RampsOrder` (DepositOrder shape)\n * for all provider types, including both aggregator and native providers.\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 */\n async getOrder(\n providerCode: string,\n orderCode: string,\n wallet: string,\n ): Promise<RampsOrder> {\n const url = new URL(\n getApiPath(`providers/${providerCode}/orders/${orderCode}`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(url);\n url.searchParams.set('wallet', wallet);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<RampsOrder>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from order API');\n }\n\n return response;\n }\n\n /**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 API backend, which knows how to parse\n * each provider's callback format and extract the order ID. Then fetches\n * the full order using that ID.\n *\n * This is the V2 equivalent of the aggregator 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 */\n async getOrderFromCallback(\n providerCode: string,\n callbackUrl: string,\n wallet: string,\n ): Promise<RampsOrder> {\n // Step 1: Send the callback URL to the backend to extract the order ID.\n // The backend parses it using provider-specific logic.\n const callbackApiUrl = new URL(\n getApiPath(`providers/${providerCode}/callback`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(callbackApiUrl);\n callbackApiUrl.searchParams.set('url', callbackUrl);\n\n const callbackResponse = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(callbackApiUrl);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${callbackApiUrl.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ id: string }>;\n });\n\n const rawOrderId = callbackResponse?.id;\n if (!rawOrderId) {\n throw new Error(\n 'Could not extract order ID from callback URL via provider',\n );\n }\n\n // The callback response id may be a full resource path like\n // \"/providers/transak-staging/orders/3ec2e8ac-...\".\n // Extract just the order code (last segment) so getOrder doesn't\n // build a doubled path.\n const lastSlash = rawOrderId.lastIndexOf('/');\n const orderCode =\n lastSlash >= 0 ? rawOrderId.slice(lastSlash + 1) : rawOrderId;\n\n // Step 2: Fetch the full order using the extracted order code.\n return this.getOrder(providerCode, orderCode, wallet);\n }\n}\n"]}
{"version":3,"file":"RampsService.cjs","sourceRoot":"","sources":["../src/RampsService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,iEAA4E;AAI5E,mEAA0C;AAwe1C,sBAAsB;AAEtB;;GAEG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,4CAAwB,CAAA;AAC1B,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B;AA8FD;;GAEG;AACU,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAOzC,kBAAkB;AAElB;;;GAGG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;IAC3B,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,oBAAoB;AAEpB,MAAM,yBAAyB,GAAG;IAChC,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,UAAU;IACV,sBAAsB;CACd,CAAC;AAgCX,6BAA6B;AAE7B;;;;;;;GAOG;AACH,SAAS,UAAU,CACjB,WAA6B,EAC7B,OAAwB;IAExB,MAAM,KAAK,GAAG,OAAO,KAAK,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EA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AC,GAAG,CAAC,YAAY,EAAE,sBAAW,CAAC,OAAO,CAAC,CAAC;IACxD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,uBAAA,IAAI,6BAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,gCACH,OAAwB,EACxB,IAAY,EACZ,OAGC;IAED,OAAO,uBAAA,IAAI,4BAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAA,IAAI,yDAAY,MAAhB,IAAI,EAAa,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,uBAAA,IAAI,8DAAiB,MAArB,IAAI,EAAkB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,2BAAO,MAAX,IAAI,EAAQ,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,4BAAS,CACjB,QAAQ,CAAC,MAAM,EACf,aAAa,GAAG,CAAC,QAAQ,EAAE,yBAAyB,QAAQ,CAAC,MAAM,GAAG,CACvE,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC,YAAY,KAAK,MAAM;YACpC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB;YACzC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport { createServicePolicy, HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\n\nimport type { RampsServiceMethodActions } from './RampsService-method-action-types';\nimport packageJson from '../package.json';\n\n/**\n * Represents phone number information for a country.\n */\nexport type CountryPhone = {\n prefix: string;\n placeholder: string;\n template: string;\n};\n\n/**\n * Indicates whether a region supports buy and/or sell actions.\n */\nexport type SupportedActions = {\n /**\n * Whether buy actions are supported.\n */\n buy: boolean;\n /**\n * Whether sell actions are supported.\n */\n sell: boolean;\n};\n\n/**\n * Represents a state/province within a country.\n */\nexport type State = {\n /**\n * State identifier. Can be in path format (e.g., \"/regions/us-ut\") or ISO code format (e.g., \"us-ut\").\n */\n id?: string;\n /**\n * State name.\n */\n name?: string;\n /**\n * ISO state code (e.g., \"UT\", \"NY\").\n */\n stateId?: string;\n /**\n * Whether this state is supported for buy and/or sell ramp actions.\n */\n supported?: SupportedActions;\n /**\n * Whether this state is recommended.\n */\n recommended?: boolean;\n};\n\n/**\n * Represents a provider link.\n */\nexport type ProviderLink = {\n name: string;\n url: string;\n};\n\n/**\n * Represents provider logos.\n */\nexport type ProviderLogos = {\n light: string;\n dark: string;\n height: number;\n width: number;\n};\n\n/**\n * Browser type for provider buy features.\n */\nexport type ProviderBrowserType = 'APP_BROWSER' | 'IN_APP_OS_BROWSER' | null;\n\n/**\n * Represents a ramp provider.\n */\nexport type Provider = {\n id: string;\n name: string;\n environmentType: string;\n description: string;\n hqAddress: string;\n links: ProviderLink[];\n logos: ProviderLogos;\n supportedCryptoCurrencies?: Record<string, boolean>;\n supportedFiatCurrencies?: Record<string, boolean>;\n supportedPaymentMethods?: Record<string, boolean>;\n};\n\n/**\n * Represents a payment method for funding a purchase.\n */\nexport type PaymentMethod = {\n /**\n * Canonical payment method ID (e.g., \"/payments/debit-credit-card\").\n */\n id: string;\n /**\n * Payment type identifier (e.g., \"debit-credit-card\", \"bank-transfer\").\n */\n paymentType: string;\n /**\n * User-facing name for the payment method.\n */\n name: string;\n /**\n * Score for sorting payment methods (higher is better).\n */\n score: number;\n /**\n * Icon identifier for the payment method.\n */\n icon: string;\n /**\n * Localized disclaimer text (optional).\n */\n disclaimer?: string;\n /**\n * Delay in minutes (e.g., [5, 10]).\n */\n delay?: number[];\n /**\n * Localized pending order description (optional).\n */\n pendingOrderDescription?: string;\n /**\n * Whether this payment method is a manual bank transfer.\n */\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Response from the paymentMethods API.\n */\nexport type PaymentMethodsResponse = {\n /**\n * List of available payment methods.\n */\n payments: PaymentMethod[];\n /**\n * Recommended sorting for payment methods.\n */\n sort?: {\n ids: string[];\n sortBy: string;\n };\n};\n\n// === QUOTES TYPES ===\n\n/**\n * Sort criteria for quotes.\n */\nexport type QuoteSortBy = 'price' | 'reliability';\n\n/**\n * Represents crypto translation info for a quote.\n */\nexport type QuoteCryptoTranslation = {\n /**\n * The crypto currency ID.\n */\n id?: string;\n /**\n * The crypto symbol.\n */\n symbol?: string;\n /**\n * The chain ID.\n */\n chainId?: string;\n};\n\n/**\n * Widget information for executing a buy order.\n */\nexport type BuyWidget = {\n /**\n * The widget URL to open for the user to complete the purchase.\n */\n url: string;\n /**\n * The browser type to use for opening the widget.\n */\n browser?: ProviderBrowserType;\n /**\n * Order ID if already created.\n */\n orderId?: string | null;\n};\n\n/**\n * Represents an individual quote from a provider.\n */\nexport type Quote = {\n /**\n * The provider ID (e.g., \"/providers/moonpay\").\n */\n provider: string;\n /**\n * The quote details.\n */\n quote: {\n /**\n * The amount the user is paying (in fiat for buy, crypto for sell).\n */\n amountIn: number | string;\n /**\n * The amount the user will receive (in crypto for buy, fiat for sell).\n */\n amountOut: number | string;\n /**\n * The payment method used for this quote.\n */\n paymentMethod: string;\n /**\n * The fiat value of the output amount (for buy actions).\n */\n amountOutInFiat?: number;\n /**\n * Crypto translation info for display.\n */\n cryptoTranslation?: QuoteCryptoTranslation;\n /**\n * Total fees in the source currency.\n */\n totalFees?: number | string;\n /**\n * Network fees.\n */\n networkFee?: number | string;\n /**\n * Provider fees.\n */\n providerFee?: number | string;\n /**\n * Buy URL endpoint that returns the actual provider widget URL.\n *\n * This is a MetaMask-hosted endpoint that, when fetched, returns JSON with the provider's widget URL.\n *\n * @deprecated Use buyWidget instead - it's embedded in the quote response.\n */\n buyURL?: string;\n /**\n * Widget information embedded in the quote response.\n * Contains the widget URL, browser type, and optional pre-order tracking ID.\n */\n buyWidget?: BuyWidget;\n };\n /**\n * Metadata about the quote.\n */\n metadata?: {\n /**\n * Reliability score for the provider (0-100).\n */\n reliability?: number;\n /**\n * Tags for the quote.\n */\n tags?: {\n /**\n * Whether this is the best rate quote.\n */\n isBestRate?: boolean;\n /**\n * Whether this is the most reliable provider.\n */\n isMostReliable?: boolean;\n };\n };\n};\n\n/**\n * Represents an error from a provider when fetching quotes.\n */\nexport type QuoteError = {\n /**\n * The provider ID that failed.\n */\n provider: string;\n /**\n * Error message.\n */\n error?: string;\n};\n\n/**\n * Sort order information for quotes.\n */\nexport type QuoteSortOrder = {\n /**\n * The sort criteria.\n */\n sortBy: QuoteSortBy;\n /**\n * Provider IDs in sorted order.\n */\n ids: string[];\n};\n\n/**\n * Custom action for a provider (e.g., Apple Pay).\n */\nexport type QuoteCustomAction = {\n /**\n * Buy action details.\n */\n buy: {\n /**\n * Provider ID.\n */\n providerId: string;\n };\n /**\n * Payment method ID this action applies to.\n */\n paymentMethodId: string;\n /**\n * Supported payment method IDs.\n */\n supportedPaymentMethodIds: string[];\n};\n\n/**\n * Response from the quotes API.\n */\nexport type QuotesResponse = {\n /**\n * Successfully retrieved quotes.\n */\n success: Quote[];\n /**\n * Sort orders for the quotes.\n */\n sorted: QuoteSortOrder[];\n /**\n * Errors from providers that failed to return quotes.\n */\n error: QuoteError[];\n /**\n * Custom actions available from providers.\n */\n customActions: QuoteCustomAction[];\n};\n\n/**\n * Parameters for fetching quotes.\n */\nexport type GetQuotesParams = {\n /**\n * The region code (e.g., \"us\", \"us-ca\").\n */\n region: string;\n /**\n * Array of payment method IDs to get quotes for.\n */\n paymentMethods: string[];\n /**\n * The CAIP-19 asset ID (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The fiat currency code (e.g., \"usd\").\n */\n fiat: string;\n /**\n * The amount (in fiat for buy, crypto for sell).\n */\n amount: number;\n /**\n * The destination wallet address.\n */\n walletAddress: string;\n /**\n * Optional redirect URL after order completion.\n */\n redirectUrl?: string;\n /**\n * Optional provider IDs to filter quotes.\n */\n providers?: string[];\n /**\n * The ramp action type. Defaults to 'buy'.\n */\n action?: RampAction;\n};\n\n/**\n * Represents a country returned from the regions/countries API.\n */\nexport type Country = {\n /**\n * ISO-2 country code (e.g., \"US\", \"GB\").\n */\n isoCode: string;\n /**\n * Country identifier. Can be in path format (e.g., \"/regions/us\") or ISO code format.\n * If not provided, defaults to isoCode.\n */\n id?: string;\n /**\n * Country flag emoji or code.\n */\n flag: string;\n /**\n * Country name.\n */\n name: string;\n /**\n * Phone number information.\n */\n phone: CountryPhone;\n /**\n * Default currency code.\n */\n currency: string;\n /**\n * Whether this country is supported for buy and/or sell ramp actions.\n */\n supported: SupportedActions;\n /**\n * Whether this country is recommended.\n */\n recommended?: boolean;\n /**\n * Array of state objects.\n */\n states?: State[];\n /**\n * Default amount for ramps transactions.\n */\n defaultAmount?: number;\n /**\n * Quick amount options for ramps transactions.\n */\n quickAmounts?: number[];\n};\n\n/**\n * Represents a token returned from the regions/{region}/tokens API.\n */\nexport type RampsToken = {\n /**\n * The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The chain identifier in CAIP-2 format (e.g., \"eip155:1\").\n */\n chainId: string;\n /**\n * Token name (e.g., \"USD Coin\").\n */\n name: string;\n /**\n * Token symbol (e.g., \"USDC\").\n */\n symbol: string;\n /**\n * Number of decimals for the token.\n */\n decimals: number;\n /**\n * URL to the token icon.\n */\n iconUrl: string;\n /**\n * Whether this token is supported.\n */\n tokenSupported: boolean;\n};\n\n/**\n * Response from the regions/{region}/tokens API.\n */\nexport type TokensResponse = {\n /**\n * Top/popular tokens for the region.\n */\n topTokens: RampsToken[];\n /**\n * All available tokens for the region.\n */\n allTokens: RampsToken[];\n};\n\n// === ORDER TYPES ===\n\n/**\n * Possible statuses for a ramps order.\n */\nexport enum RampsOrderStatus {\n Unknown = 'UNKNOWN',\n Precreated = 'PRECREATED',\n Created = 'CREATED',\n Pending = 'PENDING',\n Failed = 'FAILED',\n Completed = 'COMPLETED',\n Cancelled = 'CANCELLED',\n IdExpired = 'ID_EXPIRED',\n}\n\n/**\n * Network information associated with an order.\n */\nexport type RampsOrderNetwork = {\n name: string;\n chainId: string;\n};\n\n/**\n * Crypto currency information associated with an order.\n */\nexport type RampsOrderCryptoCurrency = {\n assetId?: string;\n name?: string;\n chainId?: string;\n decimals?: number;\n iconUrl?: string;\n symbol: string;\n};\n\n/**\n * Payment method information associated with an order.\n */\nexport type RampsOrderPaymentMethod = {\n id: string;\n name?: string;\n shortName?: string;\n duration?: string;\n icon?: string;\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Bank transfer instruction fields attached to an order by providers\n * that require manual payment (e.g. SEPA, wire transfer).\n */\nexport type OrderPaymentDetail = {\n fiatCurrency: string;\n paymentMethod: string;\n fields: { name: string; id: string; value: string }[];\n};\n\n/**\n * Fiat currency information associated with an order.\n */\nexport type RampsOrderFiatCurrency = {\n id?: string;\n symbol: string;\n name?: string;\n decimals?: number;\n denomSymbol?: string;\n};\n\n/**\n * A unified order type returned from the V2 API.\n * The V2 endpoint normalizes all provider responses into this shape.\n */\nexport type RampsOrder = {\n id?: string;\n isOnlyLink: boolean;\n provider?: Provider;\n success: boolean;\n cryptoAmount: string | number;\n fiatAmount: number;\n cryptoCurrency?: RampsOrderCryptoCurrency;\n fiatCurrency?: RampsOrderFiatCurrency;\n providerOrderId: string;\n providerOrderLink: string;\n createdAt: number;\n paymentMethod?: RampsOrderPaymentMethod;\n totalFeesFiat: number;\n txHash: string;\n walletAddress: string;\n status: RampsOrderStatus;\n network: RampsOrderNetwork;\n canBeUpdated: boolean;\n idHasExpired: boolean;\n idExpirationDate?: number;\n excludeFromPurchases: boolean;\n timeDescriptionPending: string;\n fiatAmountInUsd?: number;\n feesInUsd?: number;\n region?: string;\n orderType: string;\n exchangeRate?: number;\n pollingSecondsMinimum?: number;\n statusDescription?: string;\n partnerFees?: number;\n networkFees?: number;\n paymentDetails?: OrderPaymentDetail[];\n};\n\n/**\n * The SDK version to send with API requests. (backwards-compatibility)\n */\nexport const RAMPS_SDK_VERSION = '2.1.6';\n\n/**\n * The type of ramp action: 'buy' or 'sell'.\n */\nexport type RampAction = 'buy' | 'sell';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link RampsService}, used to namespace the\n * service's actions and events.\n */\nexport const serviceName = 'RampsService';\n\n/**\n * The environment to use for API requests.\n */\nexport enum RampsEnvironment {\n Production = 'production',\n Staging = 'staging',\n Development = 'development',\n Local = 'local',\n}\n\n/**\n * The type of ramps API service.\n * Determines which base URL to use (cache vs standard).\n */\nexport enum RampsApiService {\n Regions = 'regions',\n Orders = 'orders',\n}\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getGeolocation',\n 'getCountries',\n 'getTokens',\n 'getProviders',\n 'getPaymentMethods',\n 'getQuotes',\n 'getBuyWidgetUrl',\n 'getOrder',\n 'getOrderFromCallback',\n] as const;\n\n/**\n * Actions that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceActions = RampsServiceMethodActions;\n\n/**\n * Actions from other messengers that {@link RampsService} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Events that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceEvents = never;\n\n/**\n * Events from other messengers that {@link RampsService} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link RampsService}.\n */\nexport type RampsServiceMessenger = Messenger<\n typeof serviceName,\n RampsServiceActions | AllowedActions,\n RampsServiceEvents | AllowedEvents\n>;\n\n// === SERVICE DEFINITION ===\n\n/**\n * Gets the base URL for API requests based on the environment and service type.\n * The Regions service uses a cache URL, while other services use the standard URL.\n *\n * @param environment - The environment to use.\n * @param service - The API service type (determines if cache URL is used).\n * @returns The base URL for API requests.\n */\nfunction getBaseUrl(\n environment: RampsEnvironment,\n service: RampsApiService,\n): string {\n const cache = service === RampsApiService.Regions ? '-cache' : '';\n\n switch (environment) {\n case RampsEnvironment.Production:\n return `https://on-ramp${cache}.api.cx.metamask.io`;\n case RampsEnvironment.Staging:\n case RampsEnvironment.Development:\n return `https://on-ramp${cache}.uat-api.cx.metamask.io`;\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Constructs an API path with a version prefix.\n *\n * @param path - The API endpoint path.\n * @param version - The API version prefix. Defaults to 'v2'.\n * @returns The versioned API path.\n */\nfunction getApiPath(path: string, version: string = 'v2'): string {\n return `${version}/${path}`;\n}\n\n/**\n * This service object is responsible for interacting with the Ramps API.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * RampsServiceActions,\n * RampsServiceEvents,\n * } from '@metamask/ramps-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * RampsServiceActions\n * RampsServiceEvents\n * >({ namespace: 'Root' });\n * const rampsServiceMessenger = new Messenger<\n * 'RampsService',\n * RampsServiceActions,\n * RampsServiceEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'RampsService',\n * parent: rootMessenger,\n * });\n * // Instantiate the service to register its actions on the messenger\n * new RampsService({\n * messenger: rampsServiceMessenger,\n * environment: RampsEnvironment.Production,\n * context: 'mobile-ios',\n * fetch,\n * });\n *\n * // Later...\n * // Get the user's geolocation\n * const geolocation = await rootMessenger.call(\n * 'RampsService:getGeolocation',\n * );\n * // ... Do something with the geolocation ...\n * ```\n */\nexport class RampsService {\n /**\n * The name of the service.\n */\n readonly name: typeof serviceName;\n\n /**\n * The messenger suited for this service.\n */\n readonly #messenger: ConstructorParameters<\n typeof RampsService\n >[0]['messenger'];\n\n /**\n * A function that can be used to make an HTTP request.\n */\n readonly #fetch: ConstructorParameters<typeof RampsService>[0]['fetch'];\n\n /**\n * The policy that wraps the request.\n *\n * @see {@link createServicePolicy}\n */\n readonly #policy: ServicePolicy;\n\n /**\n * The environment used for API requests.\n */\n readonly #environment: RampsEnvironment;\n\n /**\n * The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n */\n readonly #context: string;\n\n /**\n * Optional base URL override for local development.\n */\n readonly #baseUrlOverride?: string;\n\n /**\n * Constructs a new RampsService object.\n *\n * @param args - The constructor arguments.\n * @param args.messenger - The messenger suited for this service.\n * @param args.environment - The environment to use for API requests.\n * @param args.context - The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n * @param args.fetch - A function that can be used to make an HTTP request. If\n * your JavaScript environment supports `fetch` natively, you'll probably want\n * to pass that; otherwise you can pass an equivalent (such as `fetch` via\n * `node-fetch`).\n * @param args.policyOptions - Options to pass to `createServicePolicy`, which\n * is used to wrap each request. See {@link CreateServicePolicyOptions}.\n * @param args.baseUrlOverride - Optional base URL override for local development.\n */\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: RampsServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy(policyOptions);\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Gets the base URL for API requests, respecting the baseUrlOverride if set.\n *\n * @param service - The API service type.\n * @returns The base URL to use.\n */\n #getBaseUrl(service: RampsApiService): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment, service);\n }\n\n /**\n * Registers a handler that will be called after a request returns a non-500\n * response, causing a retry. Primarily useful in tests where timers are being\n * mocked.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n /**\n * Registers a handler that will be called after a set number of retry rounds\n * prove that requests to the API endpoint consistently return a 5xx response.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n /**\n * Registers a handler that will be called under one of two circumstances:\n *\n * 1. After a set number of retries prove that requests to the API\n * consistently result in one of the following failures:\n * 1. A connection initiation error\n * 2. A connection reset error\n * 3. A timeout error\n * 4. A non-JSON response\n * 5. A 502, 503, or 504 response\n * 2. After a successful request is made to the API, but the response takes\n * longer than a set duration to return.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n */\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n\n /**\n * Adds common request parameters to a URL.\n *\n * @param url - The URL to add parameters to.\n * @param action - The ramp action type (optional, not all endpoints require it).\n */\n #addCommonParams(url: URL, action?: RampAction): void {\n if (action) {\n url.searchParams.set('action', action);\n }\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n }\n\n /**\n * Makes an API request with retry policy and error handling.\n *\n * @param service - The API service type (determines base URL).\n * @param path - The endpoint path.\n * @param options - Request options.\n * @param options.action - The ramp action type (optional).\n * @param options.responseType - How to parse the response ('json' or 'text').\n * @returns The parsed response data.\n */\n async #request<TResponse>(\n service: RampsApiService,\n path: string,\n options: {\n action?: RampAction;\n responseType: 'json' | 'text';\n },\n ): Promise<TResponse> {\n return this.#policy.execute(async () => {\n const baseUrl = this.#getBaseUrl(service);\n const url = new URL(path, baseUrl);\n this.#addCommonParams(url, options.action);\n\n const response = await this.#fetch(url);\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'`,\n );\n }\n\n return options.responseType === 'json'\n ? (response.json() as Promise<TResponse>)\n : (response.text() as Promise<TResponse>);\n });\n }\n\n /**\n * Makes a request to the API in order to retrieve the user's geolocation\n * based on their IP address.\n *\n * @returns The user's country/region code (e.g., \"US-UT\" for Utah, USA).\n */\n async getGeolocation(): Promise<string> {\n const textResponse = await this.#request<string>(\n RampsApiService.Orders,\n 'geolocation',\n { responseType: 'text' },\n );\n\n const trimmedResponse = textResponse.trim();\n if (trimmedResponse.length > 0) {\n return trimmedResponse;\n }\n\n throw new Error('Malformed response received from geolocation API');\n }\n\n /**\n * Makes a request to the cached API to retrieve the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * Filters countries based on aggregator support (preserves OnRampSDK logic).\n *\n * @returns An array of countries filtered by aggregator support.\n */\n async getCountries(): Promise<Country[]> {\n const countries = await this.#request<Country[]>(\n RampsApiService.Regions,\n getApiPath('regions/countries'),\n { responseType: 'json' },\n );\n\n if (!Array.isArray(countries)) {\n throw new Error('Malformed response received from countries API');\n }\n\n return countries.filter((country) => {\n const isCountrySupported =\n country.supported.buy || country.supported.sell;\n\n if (country.states && country.states.length > 0) {\n const hasSupportedState = country.states.some(\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentionally using || to treat false as unsupported\n (state) => state.supported?.buy || state.supported?.sell,\n );\n return isCountrySupported || hasSupportedState;\n }\n\n return isCountrySupported;\n });\n }\n\n /**\n * Fetches the list of available tokens for a given region and action.\n * Supports optional provider filter.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Optional query parameters for filtering tokens.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\n async getTokens(\n region: string,\n action: RampAction = 'buy',\n options?: {\n provider?: string | string[];\n },\n ): Promise<TokensResponse> {\n const normalizedRegion = region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/topTokens`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url, action);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<TokensResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from tokens API');\n }\n\n if (\n !Array.isArray(response.topTokens) ||\n !Array.isArray(response.allTokens)\n ) {\n throw new Error('Malformed response received from tokens API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of providers for a given region.\n * Supports optional query filters: provider, crypto, fiat, payments.\n *\n * @param regionCode - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param options - Optional query parameters for filtering providers.\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 */\n async getProviders(\n regionCode: string,\n options?: {\n provider?: string | string[];\n crypto?: string | string[];\n fiat?: string | string[];\n payments?: string | string[];\n },\n ): Promise<{ providers: Provider[] }> {\n const normalizedRegion = regionCode.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/providers`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n if (options?.crypto) {\n const cryptoIds = Array.isArray(options.crypto)\n ? options.crypto\n : [options.crypto];\n cryptoIds.forEach((id) => url.searchParams.append('crypto', id));\n }\n\n if (options?.fiat) {\n const fiatIds = Array.isArray(options.fiat)\n ? options.fiat\n : [options.fiat];\n fiatIds.forEach((id) => url.searchParams.append('fiat', id));\n }\n\n if (options?.payments) {\n const paymentIds = Array.isArray(options.payments)\n ? options.payments\n : [options.payments];\n paymentIds.forEach((id) => url.searchParams.append('payments', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ providers: Provider[] }>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from providers API');\n }\n\n if (!Array.isArray(response.providers)) {\n throw new Error('Malformed response received from providers API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of payment methods for a given region, asset, and provider.\n *\n * @param options - Query parameters for filtering payment methods.\n * @param options.region - User's region code (e.g., \"us-al\").\n * @param options.fiat - Fiat currency code (e.g., \"usd\").\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 */\n async getPaymentMethods(options: {\n region: string;\n fiat: string;\n assetId: string;\n provider: string;\n }): Promise<PaymentMethodsResponse> {\n const normalizedRegion = options.region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/payments`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n url.searchParams.set('region', options.region.toLowerCase().trim());\n url.searchParams.set('fiat', options.fiat.toLowerCase().trim());\n url.searchParams.set('crypto', options.assetId);\n url.searchParams.set('provider', options.provider);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<PaymentMethodsResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n if (!Array.isArray(response.payments)) {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n return response;\n }\n\n /**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the V2 orders API to get quotes for multiple payment methods at once.\n *\n * @param params - The parameters for fetching quotes.\n * @param params.region - User's region code (e.g., \"us\", \"us-ca\").\n * @param params.paymentMethods - Array of payment method IDs.\n * @param params.assetId - CAIP-19 cryptocurrency identifier.\n * @param params.fiat - Fiat currency code (e.g., \"usd\").\n * @param params.amount - The amount (in fiat for buy, crypto for sell).\n * @param params.walletAddress - The destination wallet address.\n * @param params.redirectUrl - Optional redirect URL after order completion.\n * @param params.providers - Optional provider IDs to filter quotes.\n * @param params.action - The ramp action type. Defaults to 'buy'.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\n async getQuotes(params: GetQuotesParams): Promise<QuotesResponse> {\n const normalizedRegion = params.region.toLowerCase().trim();\n const normalizedFiat = params.fiat.toLowerCase().trim();\n const action = params.action ?? 'buy';\n\n const url = new URL(\n getApiPath('quotes'),\n getBaseUrl(this.#environment, RampsApiService.Orders),\n );\n this.#addCommonParams(url, action);\n\n // Build region ID in the format expected by the API\n url.searchParams.set('region', normalizedRegion);\n url.searchParams.set('fiat', normalizedFiat);\n url.searchParams.set('crypto', params.assetId);\n url.searchParams.set('amount', String(params.amount));\n url.searchParams.set('walletAddress', params.walletAddress);\n\n // Add payment methods as array parameters\n params.paymentMethods.forEach((paymentMethod) => {\n url.searchParams.append('payments', paymentMethod);\n });\n\n // Add provider filter if specified\n params.providers?.forEach((provider) => {\n url.searchParams.append('providers', provider);\n });\n\n // Add redirect URL if specified\n if (params.redirectUrl) {\n url.searchParams.set('redirectUrl', params.redirectUrl);\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<QuotesResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from quotes API');\n }\n\n if (\n !Array.isArray(response.success) ||\n !Array.isArray(response.sorted) ||\n !Array.isArray(response.error) ||\n !Array.isArray(response.customActions)\n ) {\n throw new Error('Malformed response received from quotes API');\n }\n\n return response;\n }\n\n /**\n * Fetches the buy widget data from a buy URL endpoint.\n * Makes a request to the buyURL (as provided in a quote) to get the actual\n * provider widget URL, browser type, and order ID.\n *\n * @param buyUrl - The full buy URL endpoint to fetch from.\n * @returns The buy widget data containing the provider widget URL.\n */\n async getBuyWidgetUrl(buyUrl: string): Promise<BuyWidget> {\n const url = new URL(buyUrl);\n this.#addCommonParams(url);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<BuyWidget>;\n });\n\n if (!response || typeof response !== 'object' || !response.url) {\n throw new Error('Malformed response received from buy widget URL API');\n }\n\n return response;\n }\n\n /**\n * Fetches an order from the unified V2 API endpoint.\n * This endpoint returns a normalized `RampsOrder` (DepositOrder shape)\n * for all provider types, including both aggregator and native providers.\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 */\n async getOrder(\n providerCode: string,\n orderCode: string,\n wallet: string,\n ): Promise<RampsOrder> {\n const url = new URL(\n getApiPath(`providers/${providerCode}/orders/${orderCode}`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(url);\n if (wallet) {\n url.searchParams.set('wallet', wallet);\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<RampsOrder>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from order API');\n }\n\n return response;\n }\n\n /**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 API backend, which knows how to parse\n * each provider's callback format and extract the order ID. Then fetches\n * the full order using that ID.\n *\n * This is the V2 equivalent of the aggregator 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 */\n async getOrderFromCallback(\n providerCode: string,\n callbackUrl: string,\n wallet: string,\n ): Promise<RampsOrder> {\n // Step 1: Send the callback URL to the backend to extract the order ID.\n // The backend parses it using provider-specific logic.\n const callbackApiUrl = new URL(\n getApiPath(`providers/${providerCode}/callback`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(callbackApiUrl);\n callbackApiUrl.searchParams.set('url', callbackUrl);\n\n const callbackResponse = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(callbackApiUrl);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${callbackApiUrl.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ id: string }>;\n });\n\n const rawOrderId = callbackResponse?.id;\n if (!rawOrderId) {\n throw new Error(\n 'Could not extract order ID from callback URL via provider',\n );\n }\n\n // The callback response id may be a full resource path like\n // \"/providers/transak-staging/orders/3ec2e8ac-...\".\n // Extract just the order code (last segment) so getOrder doesn't\n // build a doubled path.\n const lastSlash = rawOrderId.lastIndexOf('/');\n const orderCode =\n lastSlash >= 0 ? rawOrderId.slice(lastSlash + 1) : rawOrderId;\n\n // Step 2: Fetch the full order using the extracted order code.\n return this.getOrder(providerCode, orderCode, wallet);\n }\n}\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"RampsService.d.cts","sourceRoot":"","sources":["../src/RampsService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,aAAa,EACd,mCAAmC;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAErD,OAAO,KAAK,EAAE,yBAAyB,EAAE,+CAA2C;AAGpF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;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3B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KAC9B,GACA,OAAO,CAAC;QAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;IA0DrC;;;;;;;;;OASG;IACG,iBAAiB,CAAC,OAAO,EAAE;QAC/B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmCnC;;;;;;;;;;;;;;;OAeG;IACG,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IA4DjE;;;;;;;OAOG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAsBzD;;;;;;;;;OASG;IACG,QAAQ,CACZ,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC;IA4BtB;;;;;;;;;;;;OAYG;IACG,oBAAoB,CACxB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC;CAuCvB"}

@@ -499,3 +499,5 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

__classPrivateFieldGet(this, _RampsService_instances, "m", _RampsService_addCommonParams).call(this, url);
url.searchParams.set('wallet', wallet);
if (wallet) {
url.searchParams.set('wallet', wallet);
}
const response = await __classPrivateFieldGet(this, _RampsService_policy, "f").execute(async () => {

@@ -502,0 +504,0 @@ const fetchResponse = await __classPrivateFieldGet(this, _RampsService_fetch, "f").call(this, url);

@@ -1,1 +0,1 @@

{"version":3,"file":"RampsService.mjs","sourceRoot":"","sources":["../src/R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GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,uBAAA,IAAI,6BAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,gCACH,OAAwB,EACxB,IAAY,EACZ,OAGC;IAED,OAAO,uBAAA,IAAI,4BAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAA,IAAI,yDAAY,MAAhB,IAAI,EAAa,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,uBAAA,IAAI,8DAAiB,MAArB,IAAI,EAAkB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,2BAAO,MAAX,IAAI,EAAQ,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,SAAS,CACjB,QAAQ,CAAC,MAAM,EACf,aAAa,GAAG,CAAC,QAAQ,EAAE,yBAAyB,QAAQ,CAAC,MAAM,GAAG,CACvE,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC,YAAY,KAAK,MAAM;YACpC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB;YACzC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport { createServicePolicy, HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\n\nimport type { RampsServiceMethodActions } from './RampsService-method-action-types';\nimport packageJson from '../package.json';\n\n/**\n * Represents phone number information for a country.\n */\nexport type CountryPhone = {\n prefix: string;\n placeholder: string;\n template: string;\n};\n\n/**\n * Indicates whether a region supports buy and/or sell actions.\n */\nexport type SupportedActions = {\n /**\n * Whether buy actions are supported.\n */\n buy: boolean;\n /**\n * Whether sell actions are supported.\n */\n sell: boolean;\n};\n\n/**\n * Represents a state/province within a country.\n */\nexport type State = {\n /**\n * State identifier. Can be in path format (e.g., \"/regions/us-ut\") or ISO code format (e.g., \"us-ut\").\n */\n id?: string;\n /**\n * State name.\n */\n name?: string;\n /**\n * ISO state code (e.g., \"UT\", \"NY\").\n */\n stateId?: string;\n /**\n * Whether this state is supported for buy and/or sell ramp actions.\n */\n supported?: SupportedActions;\n /**\n * Whether this state is recommended.\n */\n recommended?: boolean;\n};\n\n/**\n * Represents a provider link.\n */\nexport type ProviderLink = {\n name: string;\n url: string;\n};\n\n/**\n * Represents provider logos.\n */\nexport type ProviderLogos = {\n light: string;\n dark: string;\n height: number;\n width: number;\n};\n\n/**\n * Browser type for provider buy features.\n */\nexport type ProviderBrowserType = 'APP_BROWSER' | 'IN_APP_OS_BROWSER' | null;\n\n/**\n * Represents a ramp provider.\n */\nexport type Provider = {\n id: string;\n name: string;\n environmentType: string;\n description: string;\n hqAddress: string;\n links: ProviderLink[];\n logos: ProviderLogos;\n supportedCryptoCurrencies?: Record<string, boolean>;\n supportedFiatCurrencies?: Record<string, boolean>;\n supportedPaymentMethods?: Record<string, boolean>;\n};\n\n/**\n * Represents a payment method for funding a purchase.\n */\nexport type PaymentMethod = {\n /**\n * Canonical payment method ID (e.g., \"/payments/debit-credit-card\").\n */\n id: string;\n /**\n * Payment type identifier (e.g., \"debit-credit-card\", \"bank-transfer\").\n */\n paymentType: string;\n /**\n * User-facing name for the payment method.\n */\n name: string;\n /**\n * Score for sorting payment methods (higher is better).\n */\n score: number;\n /**\n * Icon identifier for the payment method.\n */\n icon: string;\n /**\n * Localized disclaimer text (optional).\n */\n disclaimer?: string;\n /**\n * Delay in minutes (e.g., [5, 10]).\n */\n delay?: number[];\n /**\n * Localized pending order description (optional).\n */\n pendingOrderDescription?: string;\n /**\n * Whether this payment method is a manual bank transfer.\n */\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Response from the paymentMethods API.\n */\nexport type PaymentMethodsResponse = {\n /**\n * List of available payment methods.\n */\n payments: PaymentMethod[];\n /**\n * Recommended sorting for payment methods.\n */\n sort?: {\n ids: string[];\n sortBy: string;\n };\n};\n\n// === QUOTES TYPES ===\n\n/**\n * Sort criteria for quotes.\n */\nexport type QuoteSortBy = 'price' | 'reliability';\n\n/**\n * Represents crypto translation info for a quote.\n */\nexport type QuoteCryptoTranslation = {\n /**\n * The crypto currency ID.\n */\n id?: string;\n /**\n * The crypto symbol.\n */\n symbol?: string;\n /**\n * The chain ID.\n */\n chainId?: string;\n};\n\n/**\n * Widget information for executing a buy order.\n */\nexport type BuyWidget = {\n /**\n * The widget URL to open for the user to complete the purchase.\n */\n url: string;\n /**\n * The browser type to use for opening the widget.\n */\n browser?: ProviderBrowserType;\n /**\n * Order ID if already created.\n */\n orderId?: string | null;\n};\n\n/**\n * Represents an individual quote from a provider.\n */\nexport type Quote = {\n /**\n * The provider ID (e.g., \"/providers/moonpay\").\n */\n provider: string;\n /**\n * The quote details.\n */\n quote: {\n /**\n * The amount the user is paying (in fiat for buy, crypto for sell).\n */\n amountIn: number | string;\n /**\n * The amount the user will receive (in crypto for buy, fiat for sell).\n */\n amountOut: number | string;\n /**\n * The payment method used for this quote.\n */\n paymentMethod: string;\n /**\n * The fiat value of the output amount (for buy actions).\n */\n amountOutInFiat?: number;\n /**\n * Crypto translation info for display.\n */\n cryptoTranslation?: QuoteCryptoTranslation;\n /**\n * Total fees in the source currency.\n */\n totalFees?: number | string;\n /**\n * Network fees.\n */\n networkFee?: number | string;\n /**\n * Provider fees.\n */\n providerFee?: number | string;\n /**\n * Buy URL endpoint that returns the actual provider widget URL.\n *\n * This is a MetaMask-hosted endpoint that, when fetched, returns JSON with the provider's widget URL.\n *\n * @deprecated Use buyWidget instead - it's embedded in the quote response.\n */\n buyURL?: string;\n /**\n * Widget information embedded in the quote response.\n * Contains the widget URL, browser type, and optional pre-order tracking ID.\n */\n buyWidget?: BuyWidget;\n };\n /**\n * Metadata about the quote.\n */\n metadata?: {\n /**\n * Reliability score for the provider (0-100).\n */\n reliability?: number;\n /**\n * Tags for the quote.\n */\n tags?: {\n /**\n * Whether this is the best rate quote.\n */\n isBestRate?: boolean;\n /**\n * Whether this is the most reliable provider.\n */\n isMostReliable?: boolean;\n };\n };\n};\n\n/**\n * Represents an error from a provider when fetching quotes.\n */\nexport type QuoteError = {\n /**\n * The provider ID that failed.\n */\n provider: string;\n /**\n * Error message.\n */\n error?: string;\n};\n\n/**\n * Sort order information for quotes.\n */\nexport type QuoteSortOrder = {\n /**\n * The sort criteria.\n */\n sortBy: QuoteSortBy;\n /**\n * Provider IDs in sorted order.\n */\n ids: string[];\n};\n\n/**\n * Custom action for a provider (e.g., Apple Pay).\n */\nexport type QuoteCustomAction = {\n /**\n * Buy action details.\n */\n buy: {\n /**\n * Provider ID.\n */\n providerId: string;\n };\n /**\n * Payment method ID this action applies to.\n */\n paymentMethodId: string;\n /**\n * Supported payment method IDs.\n */\n supportedPaymentMethodIds: string[];\n};\n\n/**\n * Response from the quotes API.\n */\nexport type QuotesResponse = {\n /**\n * Successfully retrieved quotes.\n */\n success: Quote[];\n /**\n * Sort orders for the quotes.\n */\n sorted: QuoteSortOrder[];\n /**\n * Errors from providers that failed to return quotes.\n */\n error: QuoteError[];\n /**\n * Custom actions available from providers.\n */\n customActions: QuoteCustomAction[];\n};\n\n/**\n * Parameters for fetching quotes.\n */\nexport type GetQuotesParams = {\n /**\n * The region code (e.g., \"us\", \"us-ca\").\n */\n region: string;\n /**\n * Array of payment method IDs to get quotes for.\n */\n paymentMethods: string[];\n /**\n * The CAIP-19 asset ID (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The fiat currency code (e.g., \"usd\").\n */\n fiat: string;\n /**\n * The amount (in fiat for buy, crypto for sell).\n */\n amount: number;\n /**\n * The destination wallet address.\n */\n walletAddress: string;\n /**\n * Optional redirect URL after order completion.\n */\n redirectUrl?: string;\n /**\n * Optional provider IDs to filter quotes.\n */\n providers?: string[];\n /**\n * The ramp action type. Defaults to 'buy'.\n */\n action?: RampAction;\n};\n\n/**\n * Represents a country returned from the regions/countries API.\n */\nexport type Country = {\n /**\n * ISO-2 country code (e.g., \"US\", \"GB\").\n */\n isoCode: string;\n /**\n * Country identifier. Can be in path format (e.g., \"/regions/us\") or ISO code format.\n * If not provided, defaults to isoCode.\n */\n id?: string;\n /**\n * Country flag emoji or code.\n */\n flag: string;\n /**\n * Country name.\n */\n name: string;\n /**\n * Phone number information.\n */\n phone: CountryPhone;\n /**\n * Default currency code.\n */\n currency: string;\n /**\n * Whether this country is supported for buy and/or sell ramp actions.\n */\n supported: SupportedActions;\n /**\n * Whether this country is recommended.\n */\n recommended?: boolean;\n /**\n * Array of state objects.\n */\n states?: State[];\n /**\n * Default amount for ramps transactions.\n */\n defaultAmount?: number;\n /**\n * Quick amount options for ramps transactions.\n */\n quickAmounts?: number[];\n};\n\n/**\n * Represents a token returned from the regions/{region}/tokens API.\n */\nexport type RampsToken = {\n /**\n * The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The chain identifier in CAIP-2 format (e.g., \"eip155:1\").\n */\n chainId: string;\n /**\n * Token name (e.g., \"USD Coin\").\n */\n name: string;\n /**\n * Token symbol (e.g., \"USDC\").\n */\n symbol: string;\n /**\n * Number of decimals for the token.\n */\n decimals: number;\n /**\n * URL to the token icon.\n */\n iconUrl: string;\n /**\n * Whether this token is supported.\n */\n tokenSupported: boolean;\n};\n\n/**\n * Response from the regions/{region}/tokens API.\n */\nexport type TokensResponse = {\n /**\n * Top/popular tokens for the region.\n */\n topTokens: RampsToken[];\n /**\n * All available tokens for the region.\n */\n allTokens: RampsToken[];\n};\n\n// === ORDER TYPES ===\n\n/**\n * Possible statuses for a ramps order.\n */\nexport enum RampsOrderStatus {\n Unknown = 'UNKNOWN',\n Precreated = 'PRECREATED',\n Created = 'CREATED',\n Pending = 'PENDING',\n Failed = 'FAILED',\n Completed = 'COMPLETED',\n Cancelled = 'CANCELLED',\n IdExpired = 'ID_EXPIRED',\n}\n\n/**\n * Network information associated with an order.\n */\nexport type RampsOrderNetwork = {\n name: string;\n chainId: string;\n};\n\n/**\n * Crypto currency information associated with an order.\n */\nexport type RampsOrderCryptoCurrency = {\n assetId?: string;\n name?: string;\n chainId?: string;\n decimals?: number;\n iconUrl?: string;\n symbol: string;\n};\n\n/**\n * Payment method information associated with an order.\n */\nexport type RampsOrderPaymentMethod = {\n id: string;\n name?: string;\n shortName?: string;\n duration?: string;\n icon?: string;\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Bank transfer instruction fields attached to an order by providers\n * that require manual payment (e.g. SEPA, wire transfer).\n */\nexport type OrderPaymentDetail = {\n fiatCurrency: string;\n paymentMethod: string;\n fields: { name: string; id: string; value: string }[];\n};\n\n/**\n * Fiat currency information associated with an order.\n */\nexport type RampsOrderFiatCurrency = {\n id?: string;\n symbol: string;\n name?: string;\n decimals?: number;\n denomSymbol?: string;\n};\n\n/**\n * A unified order type returned from the V2 API.\n * The V2 endpoint normalizes all provider responses into this shape.\n */\nexport type RampsOrder = {\n id?: string;\n isOnlyLink: boolean;\n provider?: Provider;\n success: boolean;\n cryptoAmount: string | number;\n fiatAmount: number;\n cryptoCurrency?: RampsOrderCryptoCurrency;\n fiatCurrency?: RampsOrderFiatCurrency;\n providerOrderId: string;\n providerOrderLink: string;\n createdAt: number;\n paymentMethod?: RampsOrderPaymentMethod;\n totalFeesFiat: number;\n txHash: string;\n walletAddress: string;\n status: RampsOrderStatus;\n network: RampsOrderNetwork;\n canBeUpdated: boolean;\n idHasExpired: boolean;\n idExpirationDate?: number;\n excludeFromPurchases: boolean;\n timeDescriptionPending: string;\n fiatAmountInUsd?: number;\n feesInUsd?: number;\n region?: string;\n orderType: string;\n exchangeRate?: number;\n pollingSecondsMinimum?: number;\n statusDescription?: string;\n partnerFees?: number;\n networkFees?: number;\n paymentDetails?: OrderPaymentDetail[];\n};\n\n/**\n * The SDK version to send with API requests. (backwards-compatibility)\n */\nexport const RAMPS_SDK_VERSION = '2.1.6';\n\n/**\n * The type of ramp action: 'buy' or 'sell'.\n */\nexport type RampAction = 'buy' | 'sell';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link RampsService}, used to namespace the\n * service's actions and events.\n */\nexport const serviceName = 'RampsService';\n\n/**\n * The environment to use for API requests.\n */\nexport enum RampsEnvironment {\n Production = 'production',\n Staging = 'staging',\n Development = 'development',\n Local = 'local',\n}\n\n/**\n * The type of ramps API service.\n * Determines which base URL to use (cache vs standard).\n */\nexport enum RampsApiService {\n Regions = 'regions',\n Orders = 'orders',\n}\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getGeolocation',\n 'getCountries',\n 'getTokens',\n 'getProviders',\n 'getPaymentMethods',\n 'getQuotes',\n 'getBuyWidgetUrl',\n 'getOrder',\n 'getOrderFromCallback',\n] as const;\n\n/**\n * Actions that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceActions = RampsServiceMethodActions;\n\n/**\n * Actions from other messengers that {@link RampsService} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Events that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceEvents = never;\n\n/**\n * Events from other messengers that {@link RampsService} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link RampsService}.\n */\nexport type RampsServiceMessenger = Messenger<\n typeof serviceName,\n RampsServiceActions | AllowedActions,\n RampsServiceEvents | AllowedEvents\n>;\n\n// === SERVICE DEFINITION ===\n\n/**\n * Gets the base URL for API requests based on the environment and service type.\n * The Regions service uses a cache URL, while other services use the standard URL.\n *\n * @param environment - The environment to use.\n * @param service - The API service type (determines if cache URL is used).\n * @returns The base URL for API requests.\n */\nfunction getBaseUrl(\n environment: RampsEnvironment,\n service: RampsApiService,\n): string {\n const cache = service === RampsApiService.Regions ? '-cache' : '';\n\n switch (environment) {\n case RampsEnvironment.Production:\n return `https://on-ramp${cache}.api.cx.metamask.io`;\n case RampsEnvironment.Staging:\n case RampsEnvironment.Development:\n return `https://on-ramp${cache}.uat-api.cx.metamask.io`;\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Constructs an API path with a version prefix.\n *\n * @param path - The API endpoint path.\n * @param version - The API version prefix. Defaults to 'v2'.\n * @returns The versioned API path.\n */\nfunction getApiPath(path: string, version: string = 'v2'): string {\n return `${version}/${path}`;\n}\n\n/**\n * This service object is responsible for interacting with the Ramps API.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * RampsServiceActions,\n * RampsServiceEvents,\n * } from '@metamask/ramps-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * RampsServiceActions\n * RampsServiceEvents\n * >({ namespace: 'Root' });\n * const rampsServiceMessenger = new Messenger<\n * 'RampsService',\n * RampsServiceActions,\n * RampsServiceEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'RampsService',\n * parent: rootMessenger,\n * });\n * // Instantiate the service to register its actions on the messenger\n * new RampsService({\n * messenger: rampsServiceMessenger,\n * environment: RampsEnvironment.Production,\n * context: 'mobile-ios',\n * fetch,\n * });\n *\n * // Later...\n * // Get the user's geolocation\n * const geolocation = await rootMessenger.call(\n * 'RampsService:getGeolocation',\n * );\n * // ... Do something with the geolocation ...\n * ```\n */\nexport class RampsService {\n /**\n * The name of the service.\n */\n readonly name: typeof serviceName;\n\n /**\n * The messenger suited for this service.\n */\n readonly #messenger: ConstructorParameters<\n typeof RampsService\n >[0]['messenger'];\n\n /**\n * A function that can be used to make an HTTP request.\n */\n readonly #fetch: ConstructorParameters<typeof RampsService>[0]['fetch'];\n\n /**\n * The policy that wraps the request.\n *\n * @see {@link createServicePolicy}\n */\n readonly #policy: ServicePolicy;\n\n /**\n * The environment used for API requests.\n */\n readonly #environment: RampsEnvironment;\n\n /**\n * The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n */\n readonly #context: string;\n\n /**\n * Optional base URL override for local development.\n */\n readonly #baseUrlOverride?: string;\n\n /**\n * Constructs a new RampsService object.\n *\n * @param args - The constructor arguments.\n * @param args.messenger - The messenger suited for this service.\n * @param args.environment - The environment to use for API requests.\n * @param args.context - The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n * @param args.fetch - A function that can be used to make an HTTP request. If\n * your JavaScript environment supports `fetch` natively, you'll probably want\n * to pass that; otherwise you can pass an equivalent (such as `fetch` via\n * `node-fetch`).\n * @param args.policyOptions - Options to pass to `createServicePolicy`, which\n * is used to wrap each request. See {@link CreateServicePolicyOptions}.\n * @param args.baseUrlOverride - Optional base URL override for local development.\n */\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: RampsServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy(policyOptions);\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Gets the base URL for API requests, respecting the baseUrlOverride if set.\n *\n * @param service - The API service type.\n * @returns The base URL to use.\n */\n #getBaseUrl(service: RampsApiService): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment, service);\n }\n\n /**\n * Registers a handler that will be called after a request returns a non-500\n * response, causing a retry. Primarily useful in tests where timers are being\n * mocked.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n /**\n * Registers a handler that will be called after a set number of retry rounds\n * prove that requests to the API endpoint consistently return a 5xx response.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n /**\n * Registers a handler that will be called under one of two circumstances:\n *\n * 1. After a set number of retries prove that requests to the API\n * consistently result in one of the following failures:\n * 1. A connection initiation error\n * 2. A connection reset error\n * 3. A timeout error\n * 4. A non-JSON response\n * 5. A 502, 503, or 504 response\n * 2. After a successful request is made to the API, but the response takes\n * longer than a set duration to return.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n */\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n\n /**\n * Adds common request parameters to a URL.\n *\n * @param url - The URL to add parameters to.\n * @param action - The ramp action type (optional, not all endpoints require it).\n */\n #addCommonParams(url: URL, action?: RampAction): void {\n if (action) {\n url.searchParams.set('action', action);\n }\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n }\n\n /**\n * Makes an API request with retry policy and error handling.\n *\n * @param service - The API service type (determines base URL).\n * @param path - The endpoint path.\n * @param options - Request options.\n * @param options.action - The ramp action type (optional).\n * @param options.responseType - How to parse the response ('json' or 'text').\n * @returns The parsed response data.\n */\n async #request<TResponse>(\n service: RampsApiService,\n path: string,\n options: {\n action?: RampAction;\n responseType: 'json' | 'text';\n },\n ): Promise<TResponse> {\n return this.#policy.execute(async () => {\n const baseUrl = this.#getBaseUrl(service);\n const url = new URL(path, baseUrl);\n this.#addCommonParams(url, options.action);\n\n const response = await this.#fetch(url);\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'`,\n );\n }\n\n return options.responseType === 'json'\n ? (response.json() as Promise<TResponse>)\n : (response.text() as Promise<TResponse>);\n });\n }\n\n /**\n * Makes a request to the API in order to retrieve the user's geolocation\n * based on their IP address.\n *\n * @returns The user's country/region code (e.g., \"US-UT\" for Utah, USA).\n */\n async getGeolocation(): Promise<string> {\n const textResponse = await this.#request<string>(\n RampsApiService.Orders,\n 'geolocation',\n { responseType: 'text' },\n );\n\n const trimmedResponse = textResponse.trim();\n if (trimmedResponse.length > 0) {\n return trimmedResponse;\n }\n\n throw new Error('Malformed response received from geolocation API');\n }\n\n /**\n * Makes a request to the cached API to retrieve the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * Filters countries based on aggregator support (preserves OnRampSDK logic).\n *\n * @returns An array of countries filtered by aggregator support.\n */\n async getCountries(): Promise<Country[]> {\n const countries = await this.#request<Country[]>(\n RampsApiService.Regions,\n getApiPath('regions/countries'),\n { responseType: 'json' },\n );\n\n if (!Array.isArray(countries)) {\n throw new Error('Malformed response received from countries API');\n }\n\n return countries.filter((country) => {\n const isCountrySupported =\n country.supported.buy || country.supported.sell;\n\n if (country.states && country.states.length > 0) {\n const hasSupportedState = country.states.some(\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentionally using || to treat false as unsupported\n (state) => state.supported?.buy || state.supported?.sell,\n );\n return isCountrySupported || hasSupportedState;\n }\n\n return isCountrySupported;\n });\n }\n\n /**\n * Fetches the list of available tokens for a given region and action.\n * Supports optional provider filter.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Optional query parameters for filtering tokens.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\n async getTokens(\n region: string,\n action: RampAction = 'buy',\n options?: {\n provider?: string | string[];\n },\n ): Promise<TokensResponse> {\n const normalizedRegion = region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/topTokens`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url, action);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<TokensResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from tokens API');\n }\n\n if (\n !Array.isArray(response.topTokens) ||\n !Array.isArray(response.allTokens)\n ) {\n throw new Error('Malformed response received from tokens API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of providers for a given region.\n * Supports optional query filters: provider, crypto, fiat, payments.\n *\n * @param regionCode - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param options - Optional query parameters for filtering providers.\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 */\n async getProviders(\n regionCode: string,\n options?: {\n provider?: string | string[];\n crypto?: string | string[];\n fiat?: string | string[];\n payments?: string | string[];\n },\n ): Promise<{ providers: Provider[] }> {\n const normalizedRegion = regionCode.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/providers`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n if (options?.crypto) {\n const cryptoIds = Array.isArray(options.crypto)\n ? options.crypto\n : [options.crypto];\n cryptoIds.forEach((id) => url.searchParams.append('crypto', id));\n }\n\n if (options?.fiat) {\n const fiatIds = Array.isArray(options.fiat)\n ? options.fiat\n : [options.fiat];\n fiatIds.forEach((id) => url.searchParams.append('fiat', id));\n }\n\n if (options?.payments) {\n const paymentIds = Array.isArray(options.payments)\n ? options.payments\n : [options.payments];\n paymentIds.forEach((id) => url.searchParams.append('payments', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ providers: Provider[] }>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from providers API');\n }\n\n if (!Array.isArray(response.providers)) {\n throw new Error('Malformed response received from providers API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of payment methods for a given region, asset, and provider.\n *\n * @param options - Query parameters for filtering payment methods.\n * @param options.region - User's region code (e.g., \"us-al\").\n * @param options.fiat - Fiat currency code (e.g., \"usd\").\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 */\n async getPaymentMethods(options: {\n region: string;\n fiat: string;\n assetId: string;\n provider: string;\n }): Promise<PaymentMethodsResponse> {\n const normalizedRegion = options.region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/payments`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n url.searchParams.set('region', options.region.toLowerCase().trim());\n url.searchParams.set('fiat', options.fiat.toLowerCase().trim());\n url.searchParams.set('crypto', options.assetId);\n url.searchParams.set('provider', options.provider);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<PaymentMethodsResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n if (!Array.isArray(response.payments)) {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n return response;\n }\n\n /**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the V2 orders API to get quotes for multiple payment methods at once.\n *\n * @param params - The parameters for fetching quotes.\n * @param params.region - User's region code (e.g., \"us\", \"us-ca\").\n * @param params.paymentMethods - Array of payment method IDs.\n * @param params.assetId - CAIP-19 cryptocurrency identifier.\n * @param params.fiat - Fiat currency code (e.g., \"usd\").\n * @param params.amount - The amount (in fiat for buy, crypto for sell).\n * @param params.walletAddress - The destination wallet address.\n * @param params.redirectUrl - Optional redirect URL after order completion.\n * @param params.providers - Optional provider IDs to filter quotes.\n * @param params.action - The ramp action type. Defaults to 'buy'.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\n async getQuotes(params: GetQuotesParams): Promise<QuotesResponse> {\n const normalizedRegion = params.region.toLowerCase().trim();\n const normalizedFiat = params.fiat.toLowerCase().trim();\n const action = params.action ?? 'buy';\n\n const url = new URL(\n getApiPath('quotes'),\n getBaseUrl(this.#environment, RampsApiService.Orders),\n );\n this.#addCommonParams(url, action);\n\n // Build region ID in the format expected by the API\n url.searchParams.set('region', normalizedRegion);\n url.searchParams.set('fiat', normalizedFiat);\n url.searchParams.set('crypto', params.assetId);\n url.searchParams.set('amount', String(params.amount));\n url.searchParams.set('walletAddress', params.walletAddress);\n\n // Add payment methods as array parameters\n params.paymentMethods.forEach((paymentMethod) => {\n url.searchParams.append('payments', paymentMethod);\n });\n\n // Add provider filter if specified\n params.providers?.forEach((provider) => {\n url.searchParams.append('providers', provider);\n });\n\n // Add redirect URL if specified\n if (params.redirectUrl) {\n url.searchParams.set('redirectUrl', params.redirectUrl);\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<QuotesResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from quotes API');\n }\n\n if (\n !Array.isArray(response.success) ||\n !Array.isArray(response.sorted) ||\n !Array.isArray(response.error) ||\n !Array.isArray(response.customActions)\n ) {\n throw new Error('Malformed response received from quotes API');\n }\n\n return response;\n }\n\n /**\n * Fetches the buy widget data from a buy URL endpoint.\n * Makes a request to the buyURL (as provided in a quote) to get the actual\n * provider widget URL, browser type, and order ID.\n *\n * @param buyUrl - The full buy URL endpoint to fetch from.\n * @returns The buy widget data containing the provider widget URL.\n */\n async getBuyWidgetUrl(buyUrl: string): Promise<BuyWidget> {\n const url = new URL(buyUrl);\n this.#addCommonParams(url);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<BuyWidget>;\n });\n\n if (!response || typeof response !== 'object' || !response.url) {\n throw new Error('Malformed response received from buy widget URL API');\n }\n\n return response;\n }\n\n /**\n * Fetches an order from the unified V2 API endpoint.\n * This endpoint returns a normalized `RampsOrder` (DepositOrder shape)\n * for all provider types, including both aggregator and native providers.\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 */\n async getOrder(\n providerCode: string,\n orderCode: string,\n wallet: string,\n ): Promise<RampsOrder> {\n const url = new URL(\n getApiPath(`providers/${providerCode}/orders/${orderCode}`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(url);\n url.searchParams.set('wallet', wallet);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<RampsOrder>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from order API');\n }\n\n return response;\n }\n\n /**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 API backend, which knows how to parse\n * each provider's callback format and extract the order ID. Then fetches\n * the full order using that ID.\n *\n * This is the V2 equivalent of the aggregator 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 */\n async getOrderFromCallback(\n providerCode: string,\n callbackUrl: string,\n wallet: string,\n ): Promise<RampsOrder> {\n // Step 1: Send the callback URL to the backend to extract the order ID.\n // The backend parses it using provider-specific logic.\n const callbackApiUrl = new URL(\n getApiPath(`providers/${providerCode}/callback`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(callbackApiUrl);\n callbackApiUrl.searchParams.set('url', callbackUrl);\n\n const callbackResponse = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(callbackApiUrl);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${callbackApiUrl.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ id: string }>;\n });\n\n const rawOrderId = callbackResponse?.id;\n if (!rawOrderId) {\n throw new Error(\n 'Could not extract order ID from callback URL via provider',\n );\n }\n\n // The callback response id may be a full resource path like\n // \"/providers/transak-staging/orders/3ec2e8ac-...\".\n // Extract just the order code (last segment) so getOrder doesn't\n // build a doubled path.\n const lastSlash = rawOrderId.lastIndexOf('/');\n const orderCode =\n lastSlash >= 0 ? rawOrderId.slice(lastSlash + 1) : rawOrderId;\n\n // Step 2: Fetch the full order using the extracted order code.\n return this.getOrder(providerCode, orderCode, wallet);\n }\n}\n"]}
{"version":3,"file":"RampsService.mjs","sourceRoot":"","sources":["../src/RampsService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,mCAAmC;AAI5E,OAAO,WAAW,8CAAwB;AAwe1C,sBAAsB;AAEtB;;GAEG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,4CAAwB,CAAA;AAC1B,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AA8FD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAOzC,kBAAkB;AAElB;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;IAC3B,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,oBAAoB;AAEpB,MAAM,yBAAyB,GAAG;IAChC,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,UAAU;IACV,sBAAsB;CACd,CAAC;AAgCX,6BAA6B;AAE7B;;;;;;;GAOG;AACH,SAAS,UAAU,CACjB,WAA6B,EAC7B,OAAwB;IAExB,MAAM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,KAAK,EAAE,iBAAiB,CAAC,CAAC;IAC/C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACxD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,uBAAA,IAAI,6BAAS,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,gCACH,OAAwB,EACxB,IAAY,EACZ,OAGC;IAED,OAAO,uBAAA,IAAI,4BAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAA,IAAI,yDAAY,MAAhB,IAAI,EAAa,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,uBAAA,IAAI,8DAAiB,MAArB,IAAI,EAAkB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,2BAAO,MAAX,IAAI,EAAQ,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,SAAS,CACjB,QAAQ,CAAC,MAAM,EACf,aAAa,GAAG,CAAC,QAAQ,EAAE,yBAAyB,QAAQ,CAAC,MAAM,GAAG,CACvE,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC,YAAY,KAAK,MAAM;YACpC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB;YACzC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAyB,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport { createServicePolicy, HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\n\nimport type { RampsServiceMethodActions } from './RampsService-method-action-types';\nimport packageJson from '../package.json';\n\n/**\n * Represents phone number information for a country.\n */\nexport type CountryPhone = {\n prefix: string;\n placeholder: string;\n template: string;\n};\n\n/**\n * Indicates whether a region supports buy and/or sell actions.\n */\nexport type SupportedActions = {\n /**\n * Whether buy actions are supported.\n */\n buy: boolean;\n /**\n * Whether sell actions are supported.\n */\n sell: boolean;\n};\n\n/**\n * Represents a state/province within a country.\n */\nexport type State = {\n /**\n * State identifier. Can be in path format (e.g., \"/regions/us-ut\") or ISO code format (e.g., \"us-ut\").\n */\n id?: string;\n /**\n * State name.\n */\n name?: string;\n /**\n * ISO state code (e.g., \"UT\", \"NY\").\n */\n stateId?: string;\n /**\n * Whether this state is supported for buy and/or sell ramp actions.\n */\n supported?: SupportedActions;\n /**\n * Whether this state is recommended.\n */\n recommended?: boolean;\n};\n\n/**\n * Represents a provider link.\n */\nexport type ProviderLink = {\n name: string;\n url: string;\n};\n\n/**\n * Represents provider logos.\n */\nexport type ProviderLogos = {\n light: string;\n dark: string;\n height: number;\n width: number;\n};\n\n/**\n * Browser type for provider buy features.\n */\nexport type ProviderBrowserType = 'APP_BROWSER' | 'IN_APP_OS_BROWSER' | null;\n\n/**\n * Represents a ramp provider.\n */\nexport type Provider = {\n id: string;\n name: string;\n environmentType: string;\n description: string;\n hqAddress: string;\n links: ProviderLink[];\n logos: ProviderLogos;\n supportedCryptoCurrencies?: Record<string, boolean>;\n supportedFiatCurrencies?: Record<string, boolean>;\n supportedPaymentMethods?: Record<string, boolean>;\n};\n\n/**\n * Represents a payment method for funding a purchase.\n */\nexport type PaymentMethod = {\n /**\n * Canonical payment method ID (e.g., \"/payments/debit-credit-card\").\n */\n id: string;\n /**\n * Payment type identifier (e.g., \"debit-credit-card\", \"bank-transfer\").\n */\n paymentType: string;\n /**\n * User-facing name for the payment method.\n */\n name: string;\n /**\n * Score for sorting payment methods (higher is better).\n */\n score: number;\n /**\n * Icon identifier for the payment method.\n */\n icon: string;\n /**\n * Localized disclaimer text (optional).\n */\n disclaimer?: string;\n /**\n * Delay in minutes (e.g., [5, 10]).\n */\n delay?: number[];\n /**\n * Localized pending order description (optional).\n */\n pendingOrderDescription?: string;\n /**\n * Whether this payment method is a manual bank transfer.\n */\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Response from the paymentMethods API.\n */\nexport type PaymentMethodsResponse = {\n /**\n * List of available payment methods.\n */\n payments: PaymentMethod[];\n /**\n * Recommended sorting for payment methods.\n */\n sort?: {\n ids: string[];\n sortBy: string;\n };\n};\n\n// === QUOTES TYPES ===\n\n/**\n * Sort criteria for quotes.\n */\nexport type QuoteSortBy = 'price' | 'reliability';\n\n/**\n * Represents crypto translation info for a quote.\n */\nexport type QuoteCryptoTranslation = {\n /**\n * The crypto currency ID.\n */\n id?: string;\n /**\n * The crypto symbol.\n */\n symbol?: string;\n /**\n * The chain ID.\n */\n chainId?: string;\n};\n\n/**\n * Widget information for executing a buy order.\n */\nexport type BuyWidget = {\n /**\n * The widget URL to open for the user to complete the purchase.\n */\n url: string;\n /**\n * The browser type to use for opening the widget.\n */\n browser?: ProviderBrowserType;\n /**\n * Order ID if already created.\n */\n orderId?: string | null;\n};\n\n/**\n * Represents an individual quote from a provider.\n */\nexport type Quote = {\n /**\n * The provider ID (e.g., \"/providers/moonpay\").\n */\n provider: string;\n /**\n * The quote details.\n */\n quote: {\n /**\n * The amount the user is paying (in fiat for buy, crypto for sell).\n */\n amountIn: number | string;\n /**\n * The amount the user will receive (in crypto for buy, fiat for sell).\n */\n amountOut: number | string;\n /**\n * The payment method used for this quote.\n */\n paymentMethod: string;\n /**\n * The fiat value of the output amount (for buy actions).\n */\n amountOutInFiat?: number;\n /**\n * Crypto translation info for display.\n */\n cryptoTranslation?: QuoteCryptoTranslation;\n /**\n * Total fees in the source currency.\n */\n totalFees?: number | string;\n /**\n * Network fees.\n */\n networkFee?: number | string;\n /**\n * Provider fees.\n */\n providerFee?: number | string;\n /**\n * Buy URL endpoint that returns the actual provider widget URL.\n *\n * This is a MetaMask-hosted endpoint that, when fetched, returns JSON with the provider's widget URL.\n *\n * @deprecated Use buyWidget instead - it's embedded in the quote response.\n */\n buyURL?: string;\n /**\n * Widget information embedded in the quote response.\n * Contains the widget URL, browser type, and optional pre-order tracking ID.\n */\n buyWidget?: BuyWidget;\n };\n /**\n * Metadata about the quote.\n */\n metadata?: {\n /**\n * Reliability score for the provider (0-100).\n */\n reliability?: number;\n /**\n * Tags for the quote.\n */\n tags?: {\n /**\n * Whether this is the best rate quote.\n */\n isBestRate?: boolean;\n /**\n * Whether this is the most reliable provider.\n */\n isMostReliable?: boolean;\n };\n };\n};\n\n/**\n * Represents an error from a provider when fetching quotes.\n */\nexport type QuoteError = {\n /**\n * The provider ID that failed.\n */\n provider: string;\n /**\n * Error message.\n */\n error?: string;\n};\n\n/**\n * Sort order information for quotes.\n */\nexport type QuoteSortOrder = {\n /**\n * The sort criteria.\n */\n sortBy: QuoteSortBy;\n /**\n * Provider IDs in sorted order.\n */\n ids: string[];\n};\n\n/**\n * Custom action for a provider (e.g., Apple Pay).\n */\nexport type QuoteCustomAction = {\n /**\n * Buy action details.\n */\n buy: {\n /**\n * Provider ID.\n */\n providerId: string;\n };\n /**\n * Payment method ID this action applies to.\n */\n paymentMethodId: string;\n /**\n * Supported payment method IDs.\n */\n supportedPaymentMethodIds: string[];\n};\n\n/**\n * Response from the quotes API.\n */\nexport type QuotesResponse = {\n /**\n * Successfully retrieved quotes.\n */\n success: Quote[];\n /**\n * Sort orders for the quotes.\n */\n sorted: QuoteSortOrder[];\n /**\n * Errors from providers that failed to return quotes.\n */\n error: QuoteError[];\n /**\n * Custom actions available from providers.\n */\n customActions: QuoteCustomAction[];\n};\n\n/**\n * Parameters for fetching quotes.\n */\nexport type GetQuotesParams = {\n /**\n * The region code (e.g., \"us\", \"us-ca\").\n */\n region: string;\n /**\n * Array of payment method IDs to get quotes for.\n */\n paymentMethods: string[];\n /**\n * The CAIP-19 asset ID (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The fiat currency code (e.g., \"usd\").\n */\n fiat: string;\n /**\n * The amount (in fiat for buy, crypto for sell).\n */\n amount: number;\n /**\n * The destination wallet address.\n */\n walletAddress: string;\n /**\n * Optional redirect URL after order completion.\n */\n redirectUrl?: string;\n /**\n * Optional provider IDs to filter quotes.\n */\n providers?: string[];\n /**\n * The ramp action type. Defaults to 'buy'.\n */\n action?: RampAction;\n};\n\n/**\n * Represents a country returned from the regions/countries API.\n */\nexport type Country = {\n /**\n * ISO-2 country code (e.g., \"US\", \"GB\").\n */\n isoCode: string;\n /**\n * Country identifier. Can be in path format (e.g., \"/regions/us\") or ISO code format.\n * If not provided, defaults to isoCode.\n */\n id?: string;\n /**\n * Country flag emoji or code.\n */\n flag: string;\n /**\n * Country name.\n */\n name: string;\n /**\n * Phone number information.\n */\n phone: CountryPhone;\n /**\n * Default currency code.\n */\n currency: string;\n /**\n * Whether this country is supported for buy and/or sell ramp actions.\n */\n supported: SupportedActions;\n /**\n * Whether this country is recommended.\n */\n recommended?: boolean;\n /**\n * Array of state objects.\n */\n states?: State[];\n /**\n * Default amount for ramps transactions.\n */\n defaultAmount?: number;\n /**\n * Quick amount options for ramps transactions.\n */\n quickAmounts?: number[];\n};\n\n/**\n * Represents a token returned from the regions/{region}/tokens API.\n */\nexport type RampsToken = {\n /**\n * The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\").\n */\n assetId: string;\n /**\n * The chain identifier in CAIP-2 format (e.g., \"eip155:1\").\n */\n chainId: string;\n /**\n * Token name (e.g., \"USD Coin\").\n */\n name: string;\n /**\n * Token symbol (e.g., \"USDC\").\n */\n symbol: string;\n /**\n * Number of decimals for the token.\n */\n decimals: number;\n /**\n * URL to the token icon.\n */\n iconUrl: string;\n /**\n * Whether this token is supported.\n */\n tokenSupported: boolean;\n};\n\n/**\n * Response from the regions/{region}/tokens API.\n */\nexport type TokensResponse = {\n /**\n * Top/popular tokens for the region.\n */\n topTokens: RampsToken[];\n /**\n * All available tokens for the region.\n */\n allTokens: RampsToken[];\n};\n\n// === ORDER TYPES ===\n\n/**\n * Possible statuses for a ramps order.\n */\nexport enum RampsOrderStatus {\n Unknown = 'UNKNOWN',\n Precreated = 'PRECREATED',\n Created = 'CREATED',\n Pending = 'PENDING',\n Failed = 'FAILED',\n Completed = 'COMPLETED',\n Cancelled = 'CANCELLED',\n IdExpired = 'ID_EXPIRED',\n}\n\n/**\n * Network information associated with an order.\n */\nexport type RampsOrderNetwork = {\n name: string;\n chainId: string;\n};\n\n/**\n * Crypto currency information associated with an order.\n */\nexport type RampsOrderCryptoCurrency = {\n assetId?: string;\n name?: string;\n chainId?: string;\n decimals?: number;\n iconUrl?: string;\n symbol: string;\n};\n\n/**\n * Payment method information associated with an order.\n */\nexport type RampsOrderPaymentMethod = {\n id: string;\n name?: string;\n shortName?: string;\n duration?: string;\n icon?: string;\n isManualBankTransfer?: boolean;\n};\n\n/**\n * Bank transfer instruction fields attached to an order by providers\n * that require manual payment (e.g. SEPA, wire transfer).\n */\nexport type OrderPaymentDetail = {\n fiatCurrency: string;\n paymentMethod: string;\n fields: { name: string; id: string; value: string }[];\n};\n\n/**\n * Fiat currency information associated with an order.\n */\nexport type RampsOrderFiatCurrency = {\n id?: string;\n symbol: string;\n name?: string;\n decimals?: number;\n denomSymbol?: string;\n};\n\n/**\n * A unified order type returned from the V2 API.\n * The V2 endpoint normalizes all provider responses into this shape.\n */\nexport type RampsOrder = {\n id?: string;\n isOnlyLink: boolean;\n provider?: Provider;\n success: boolean;\n cryptoAmount: string | number;\n fiatAmount: number;\n cryptoCurrency?: RampsOrderCryptoCurrency;\n fiatCurrency?: RampsOrderFiatCurrency;\n providerOrderId: string;\n providerOrderLink: string;\n createdAt: number;\n paymentMethod?: RampsOrderPaymentMethod;\n totalFeesFiat: number;\n txHash: string;\n walletAddress: string;\n status: RampsOrderStatus;\n network: RampsOrderNetwork;\n canBeUpdated: boolean;\n idHasExpired: boolean;\n idExpirationDate?: number;\n excludeFromPurchases: boolean;\n timeDescriptionPending: string;\n fiatAmountInUsd?: number;\n feesInUsd?: number;\n region?: string;\n orderType: string;\n exchangeRate?: number;\n pollingSecondsMinimum?: number;\n statusDescription?: string;\n partnerFees?: number;\n networkFees?: number;\n paymentDetails?: OrderPaymentDetail[];\n};\n\n/**\n * The SDK version to send with API requests. (backwards-compatibility)\n */\nexport const RAMPS_SDK_VERSION = '2.1.6';\n\n/**\n * The type of ramp action: 'buy' or 'sell'.\n */\nexport type RampAction = 'buy' | 'sell';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link RampsService}, used to namespace the\n * service's actions and events.\n */\nexport const serviceName = 'RampsService';\n\n/**\n * The environment to use for API requests.\n */\nexport enum RampsEnvironment {\n Production = 'production',\n Staging = 'staging',\n Development = 'development',\n Local = 'local',\n}\n\n/**\n * The type of ramps API service.\n * Determines which base URL to use (cache vs standard).\n */\nexport enum RampsApiService {\n Regions = 'regions',\n Orders = 'orders',\n}\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getGeolocation',\n 'getCountries',\n 'getTokens',\n 'getProviders',\n 'getPaymentMethods',\n 'getQuotes',\n 'getBuyWidgetUrl',\n 'getOrder',\n 'getOrderFromCallback',\n] as const;\n\n/**\n * Actions that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceActions = RampsServiceMethodActions;\n\n/**\n * Actions from other messengers that {@link RampsService} calls.\n */\ntype AllowedActions = never;\n\n/**\n * Events that {@link RampsService} exposes to other consumers.\n */\nexport type RampsServiceEvents = never;\n\n/**\n * Events from other messengers that {@link RampsService} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link RampsService}.\n */\nexport type RampsServiceMessenger = Messenger<\n typeof serviceName,\n RampsServiceActions | AllowedActions,\n RampsServiceEvents | AllowedEvents\n>;\n\n// === SERVICE DEFINITION ===\n\n/**\n * Gets the base URL for API requests based on the environment and service type.\n * The Regions service uses a cache URL, while other services use the standard URL.\n *\n * @param environment - The environment to use.\n * @param service - The API service type (determines if cache URL is used).\n * @returns The base URL for API requests.\n */\nfunction getBaseUrl(\n environment: RampsEnvironment,\n service: RampsApiService,\n): string {\n const cache = service === RampsApiService.Regions ? '-cache' : '';\n\n switch (environment) {\n case RampsEnvironment.Production:\n return `https://on-ramp${cache}.api.cx.metamask.io`;\n case RampsEnvironment.Staging:\n case RampsEnvironment.Development:\n return `https://on-ramp${cache}.uat-api.cx.metamask.io`;\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Constructs an API path with a version prefix.\n *\n * @param path - The API endpoint path.\n * @param version - The API version prefix. Defaults to 'v2'.\n * @returns The versioned API path.\n */\nfunction getApiPath(path: string, version: string = 'v2'): string {\n return `${version}/${path}`;\n}\n\n/**\n * This service object is responsible for interacting with the Ramps API.\n *\n * @example\n *\n * ``` ts\n * import { Messenger } from '@metamask/messenger';\n * import type {\n * RampsServiceActions,\n * RampsServiceEvents,\n * } from '@metamask/ramps-controller';\n *\n * const rootMessenger = new Messenger<\n * 'Root',\n * RampsServiceActions\n * RampsServiceEvents\n * >({ namespace: 'Root' });\n * const rampsServiceMessenger = new Messenger<\n * 'RampsService',\n * RampsServiceActions,\n * RampsServiceEvents,\n * typeof rootMessenger,\n * >({\n * namespace: 'RampsService',\n * parent: rootMessenger,\n * });\n * // Instantiate the service to register its actions on the messenger\n * new RampsService({\n * messenger: rampsServiceMessenger,\n * environment: RampsEnvironment.Production,\n * context: 'mobile-ios',\n * fetch,\n * });\n *\n * // Later...\n * // Get the user's geolocation\n * const geolocation = await rootMessenger.call(\n * 'RampsService:getGeolocation',\n * );\n * // ... Do something with the geolocation ...\n * ```\n */\nexport class RampsService {\n /**\n * The name of the service.\n */\n readonly name: typeof serviceName;\n\n /**\n * The messenger suited for this service.\n */\n readonly #messenger: ConstructorParameters<\n typeof RampsService\n >[0]['messenger'];\n\n /**\n * A function that can be used to make an HTTP request.\n */\n readonly #fetch: ConstructorParameters<typeof RampsService>[0]['fetch'];\n\n /**\n * The policy that wraps the request.\n *\n * @see {@link createServicePolicy}\n */\n readonly #policy: ServicePolicy;\n\n /**\n * The environment used for API requests.\n */\n readonly #environment: RampsEnvironment;\n\n /**\n * The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n */\n readonly #context: string;\n\n /**\n * Optional base URL override for local development.\n */\n readonly #baseUrlOverride?: string;\n\n /**\n * Constructs a new RampsService object.\n *\n * @param args - The constructor arguments.\n * @param args.messenger - The messenger suited for this service.\n * @param args.environment - The environment to use for API requests.\n * @param args.context - The context for API requests (e.g., 'mobile-ios', 'mobile-android').\n * @param args.fetch - A function that can be used to make an HTTP request. If\n * your JavaScript environment supports `fetch` natively, you'll probably want\n * to pass that; otherwise you can pass an equivalent (such as `fetch` via\n * `node-fetch`).\n * @param args.policyOptions - Options to pass to `createServicePolicy`, which\n * is used to wrap each request. See {@link CreateServicePolicyOptions}.\n * @param args.baseUrlOverride - Optional base URL override for local development.\n */\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: RampsServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy(policyOptions);\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Gets the base URL for API requests, respecting the baseUrlOverride if set.\n *\n * @param service - The API service type.\n * @returns The base URL to use.\n */\n #getBaseUrl(service: RampsApiService): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment, service);\n }\n\n /**\n * Registers a handler that will be called after a request returns a non-500\n * response, causing a retry. Primarily useful in tests where timers are being\n * mocked.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n /**\n * Registers a handler that will be called after a set number of retry rounds\n * prove that requests to the API endpoint consistently return a 5xx response.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n * @see {@link createServicePolicy}\n */\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n /**\n * Registers a handler that will be called under one of two circumstances:\n *\n * 1. After a set number of retries prove that requests to the API\n * consistently result in one of the following failures:\n * 1. A connection initiation error\n * 2. A connection reset error\n * 3. A timeout error\n * 4. A non-JSON response\n * 5. A 502, 503, or 504 response\n * 2. After a successful request is made to the API, but the response takes\n * longer than a set duration to return.\n *\n * @param listener - The handler to be called.\n * @returns An object that can be used to unregister the handler. See\n * {@link CockatielEvent}.\n */\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n\n /**\n * Adds common request parameters to a URL.\n *\n * @param url - The URL to add parameters to.\n * @param action - The ramp action type (optional, not all endpoints require it).\n */\n #addCommonParams(url: URL, action?: RampAction): void {\n if (action) {\n url.searchParams.set('action', action);\n }\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n }\n\n /**\n * Makes an API request with retry policy and error handling.\n *\n * @param service - The API service type (determines base URL).\n * @param path - The endpoint path.\n * @param options - Request options.\n * @param options.action - The ramp action type (optional).\n * @param options.responseType - How to parse the response ('json' or 'text').\n * @returns The parsed response data.\n */\n async #request<TResponse>(\n service: RampsApiService,\n path: string,\n options: {\n action?: RampAction;\n responseType: 'json' | 'text';\n },\n ): Promise<TResponse> {\n return this.#policy.execute(async () => {\n const baseUrl = this.#getBaseUrl(service);\n const url = new URL(path, baseUrl);\n this.#addCommonParams(url, options.action);\n\n const response = await this.#fetch(url);\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'`,\n );\n }\n\n return options.responseType === 'json'\n ? (response.json() as Promise<TResponse>)\n : (response.text() as Promise<TResponse>);\n });\n }\n\n /**\n * Makes a request to the API in order to retrieve the user's geolocation\n * based on their IP address.\n *\n * @returns The user's country/region code (e.g., \"US-UT\" for Utah, USA).\n */\n async getGeolocation(): Promise<string> {\n const textResponse = await this.#request<string>(\n RampsApiService.Orders,\n 'geolocation',\n { responseType: 'text' },\n );\n\n const trimmedResponse = textResponse.trim();\n if (trimmedResponse.length > 0) {\n return trimmedResponse;\n }\n\n throw new Error('Malformed response received from geolocation API');\n }\n\n /**\n * Makes a request to the cached API to retrieve the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * Filters countries based on aggregator support (preserves OnRampSDK logic).\n *\n * @returns An array of countries filtered by aggregator support.\n */\n async getCountries(): Promise<Country[]> {\n const countries = await this.#request<Country[]>(\n RampsApiService.Regions,\n getApiPath('regions/countries'),\n { responseType: 'json' },\n );\n\n if (!Array.isArray(countries)) {\n throw new Error('Malformed response received from countries API');\n }\n\n return countries.filter((country) => {\n const isCountrySupported =\n country.supported.buy || country.supported.sell;\n\n if (country.states && country.states.length > 0) {\n const hasSupportedState = country.states.some(\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentionally using || to treat false as unsupported\n (state) => state.supported?.buy || state.supported?.sell,\n );\n return isCountrySupported || hasSupportedState;\n }\n\n return isCountrySupported;\n });\n }\n\n /**\n * Fetches the list of available tokens for a given region and action.\n * Supports optional provider filter.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Optional query parameters for filtering tokens.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\n async getTokens(\n region: string,\n action: RampAction = 'buy',\n options?: {\n provider?: string | string[];\n },\n ): Promise<TokensResponse> {\n const normalizedRegion = region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/topTokens`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url, action);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<TokensResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from tokens API');\n }\n\n if (\n !Array.isArray(response.topTokens) ||\n !Array.isArray(response.allTokens)\n ) {\n throw new Error('Malformed response received from tokens API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of providers for a given region.\n * Supports optional query filters: provider, crypto, fiat, payments.\n *\n * @param regionCode - The region code (e.g., \"us\", \"fr\", \"us-ny\").\n * @param options - Optional query parameters for filtering providers.\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 */\n async getProviders(\n regionCode: string,\n options?: {\n provider?: string | string[];\n crypto?: string | string[];\n fiat?: string | string[];\n payments?: string | string[];\n },\n ): Promise<{ providers: Provider[] }> {\n const normalizedRegion = regionCode.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/providers`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n if (options?.provider) {\n const providerIds = Array.isArray(options.provider)\n ? options.provider\n : [options.provider];\n providerIds.forEach((id) => url.searchParams.append('provider', id));\n }\n\n if (options?.crypto) {\n const cryptoIds = Array.isArray(options.crypto)\n ? options.crypto\n : [options.crypto];\n cryptoIds.forEach((id) => url.searchParams.append('crypto', id));\n }\n\n if (options?.fiat) {\n const fiatIds = Array.isArray(options.fiat)\n ? options.fiat\n : [options.fiat];\n fiatIds.forEach((id) => url.searchParams.append('fiat', id));\n }\n\n if (options?.payments) {\n const paymentIds = Array.isArray(options.payments)\n ? options.payments\n : [options.payments];\n paymentIds.forEach((id) => url.searchParams.append('payments', id));\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ providers: Provider[] }>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from providers API');\n }\n\n if (!Array.isArray(response.providers)) {\n throw new Error('Malformed response received from providers API');\n }\n\n return response;\n }\n\n /**\n * Fetches the list of payment methods for a given region, asset, and provider.\n *\n * @param options - Query parameters for filtering payment methods.\n * @param options.region - User's region code (e.g., \"us-al\").\n * @param options.fiat - Fiat currency code (e.g., \"usd\").\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 */\n async getPaymentMethods(options: {\n region: string;\n fiat: string;\n assetId: string;\n provider: string;\n }): Promise<PaymentMethodsResponse> {\n const normalizedRegion = options.region.toLowerCase().trim();\n const url = new URL(\n getApiPath(`regions/${normalizedRegion}/payments`),\n this.#getBaseUrl(RampsApiService.Regions),\n );\n this.#addCommonParams(url);\n\n url.searchParams.set('region', options.region.toLowerCase().trim());\n url.searchParams.set('fiat', options.fiat.toLowerCase().trim());\n url.searchParams.set('crypto', options.assetId);\n url.searchParams.set('provider', options.provider);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<PaymentMethodsResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n if (!Array.isArray(response.payments)) {\n throw new Error('Malformed response received from paymentMethods API');\n }\n\n return response;\n }\n\n /**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the V2 orders API to get quotes for multiple payment methods at once.\n *\n * @param params - The parameters for fetching quotes.\n * @param params.region - User's region code (e.g., \"us\", \"us-ca\").\n * @param params.paymentMethods - Array of payment method IDs.\n * @param params.assetId - CAIP-19 cryptocurrency identifier.\n * @param params.fiat - Fiat currency code (e.g., \"usd\").\n * @param params.amount - The amount (in fiat for buy, crypto for sell).\n * @param params.walletAddress - The destination wallet address.\n * @param params.redirectUrl - Optional redirect URL after order completion.\n * @param params.providers - Optional provider IDs to filter quotes.\n * @param params.action - The ramp action type. Defaults to 'buy'.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\n async getQuotes(params: GetQuotesParams): Promise<QuotesResponse> {\n const normalizedRegion = params.region.toLowerCase().trim();\n const normalizedFiat = params.fiat.toLowerCase().trim();\n const action = params.action ?? 'buy';\n\n const url = new URL(\n getApiPath('quotes'),\n getBaseUrl(this.#environment, RampsApiService.Orders),\n );\n this.#addCommonParams(url, action);\n\n // Build region ID in the format expected by the API\n url.searchParams.set('region', normalizedRegion);\n url.searchParams.set('fiat', normalizedFiat);\n url.searchParams.set('crypto', params.assetId);\n url.searchParams.set('amount', String(params.amount));\n url.searchParams.set('walletAddress', params.walletAddress);\n\n // Add payment methods as array parameters\n params.paymentMethods.forEach((paymentMethod) => {\n url.searchParams.append('payments', paymentMethod);\n });\n\n // Add provider filter if specified\n params.providers?.forEach((provider) => {\n url.searchParams.append('providers', provider);\n });\n\n // Add redirect URL if specified\n if (params.redirectUrl) {\n url.searchParams.set('redirectUrl', params.redirectUrl);\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<QuotesResponse>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from quotes API');\n }\n\n if (\n !Array.isArray(response.success) ||\n !Array.isArray(response.sorted) ||\n !Array.isArray(response.error) ||\n !Array.isArray(response.customActions)\n ) {\n throw new Error('Malformed response received from quotes API');\n }\n\n return response;\n }\n\n /**\n * Fetches the buy widget data from a buy URL endpoint.\n * Makes a request to the buyURL (as provided in a quote) to get the actual\n * provider widget URL, browser type, and order ID.\n *\n * @param buyUrl - The full buy URL endpoint to fetch from.\n * @returns The buy widget data containing the provider widget URL.\n */\n async getBuyWidgetUrl(buyUrl: string): Promise<BuyWidget> {\n const url = new URL(buyUrl);\n this.#addCommonParams(url);\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<BuyWidget>;\n });\n\n if (!response || typeof response !== 'object' || !response.url) {\n throw new Error('Malformed response received from buy widget URL API');\n }\n\n return response;\n }\n\n /**\n * Fetches an order from the unified V2 API endpoint.\n * This endpoint returns a normalized `RampsOrder` (DepositOrder shape)\n * for all provider types, including both aggregator and native providers.\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 */\n async getOrder(\n providerCode: string,\n orderCode: string,\n wallet: string,\n ): Promise<RampsOrder> {\n const url = new URL(\n getApiPath(`providers/${providerCode}/orders/${orderCode}`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(url);\n if (wallet) {\n url.searchParams.set('wallet', wallet);\n }\n\n const response = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(url);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${url.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<RampsOrder>;\n });\n\n if (!response || typeof response !== 'object') {\n throw new Error('Malformed response received from order API');\n }\n\n return response;\n }\n\n /**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 API backend, which knows how to parse\n * each provider's callback format and extract the order ID. Then fetches\n * the full order using that ID.\n *\n * This is the V2 equivalent of the aggregator 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 */\n async getOrderFromCallback(\n providerCode: string,\n callbackUrl: string,\n wallet: string,\n ): Promise<RampsOrder> {\n // Step 1: Send the callback URL to the backend to extract the order ID.\n // The backend parses it using provider-specific logic.\n const callbackApiUrl = new URL(\n getApiPath(`providers/${providerCode}/callback`),\n this.#getBaseUrl(RampsApiService.Orders),\n );\n this.#addCommonParams(callbackApiUrl);\n callbackApiUrl.searchParams.set('url', callbackUrl);\n\n const callbackResponse = await this.#policy.execute(async () => {\n const fetchResponse = await this.#fetch(callbackApiUrl);\n if (!fetchResponse.ok) {\n throw new HttpError(\n fetchResponse.status,\n `Fetching '${callbackApiUrl.toString()}' failed with status '${fetchResponse.status}'`,\n );\n }\n return fetchResponse.json() as Promise<{ id: string }>;\n });\n\n const rawOrderId = callbackResponse?.id;\n if (!rawOrderId) {\n throw new Error(\n 'Could not extract order ID from callback URL via provider',\n );\n }\n\n // The callback response id may be a full resource path like\n // \"/providers/transak-staging/orders/3ec2e8ac-...\".\n // Extract just the order code (last segment) so getOrder doesn't\n // build a doubled path.\n const lastSlash = rawOrderId.lastIndexOf('/');\n const orderCode =\n lastSlash >= 0 ? rawOrderId.slice(lastSlash + 1) : rawOrderId;\n\n // Step 2: Fetch the full order using the extracted order code.\n return this.getOrder(providerCode, orderCode, wallet);\n }\n}\n"]}
{
"name": "@metamask/ramps-controller",
"version": "12.0.0",
"version": "12.0.1",
"description": "A controller for managing cryptocurrency on/off ramps functionality",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display