@metamask/ramps-controller 20.3.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/dist/{NeoBankService-method-action-types.d.mts → NeoBankService-method-action-types.d.ts} +2 -2
- package/dist/NeoBankService-method-action-types.d.ts.map +1 -0
- package/dist/{NeoBankService-method-action-types.mjs → NeoBankService-method-action-types.js} +1 -1
- package/dist/NeoBankService-method-action-types.js.map +1 -0
- package/dist/{NeoBankService.d.cts → NeoBankService.d.ts} +8 -8
- package/dist/NeoBankService.d.ts.map +1 -0
- package/dist/NeoBankService.js +380 -0
- package/dist/NeoBankService.js.map +1 -0
- package/dist/{RampsController-method-action-types.d.mts → RampsController-method-action-types.d.ts} +2 -2
- package/dist/RampsController-method-action-types.d.ts.map +1 -0
- package/dist/{TransakService-method-action-types.mjs → RampsController-method-action-types.js} +1 -1
- package/dist/RampsController-method-action-types.js.map +1 -0
- package/dist/{RampsController.d.cts → RampsController.d.ts} +19 -19
- package/dist/RampsController.d.ts.map +1 -0
- package/dist/{RampsController.mjs → RampsController.js} +725 -613
- package/dist/RampsController.js.map +1 -0
- package/dist/{RampsService-method-action-types.d.cts → RampsService-method-action-types.d.ts} +2 -2
- package/dist/RampsService-method-action-types.d.ts.map +1 -0
- package/dist/{RampsService-method-action-types.mjs → RampsService-method-action-types.js} +1 -1
- package/dist/RampsService-method-action-types.js.map +1 -0
- package/dist/{RampsService.d.mts → RampsService.d.ts} +5 -5
- package/dist/RampsService.d.ts.map +1 -0
- package/dist/{RampsService.mjs → RampsService.js} +159 -147
- package/dist/RampsService.js.map +1 -0
- package/dist/{RequestCache.d.mts → RequestCache.d.ts} +3 -3
- package/dist/RequestCache.d.ts.map +1 -0
- package/dist/{RequestCache.mjs → RequestCache.js} +1 -1
- package/dist/RequestCache.js.map +1 -0
- package/dist/{TransakService-method-action-types.d.cts → TransakService-method-action-types.d.ts} +2 -2
- package/dist/TransakService-method-action-types.d.ts.map +1 -0
- package/dist/{RampsController-method-action-types.mjs → TransakService-method-action-types.js} +1 -1
- package/dist/TransakService-method-action-types.js.map +1 -0
- package/dist/{TransakService.d.cts → TransakService.d.ts} +6 -6
- package/dist/TransakService.d.ts.map +1 -0
- package/dist/TransakService.js +746 -0
- package/dist/TransakService.js.map +1 -0
- package/dist/{autoramp-types.d.cts → autoramp-types.d.ts} +1 -1
- package/dist/autoramp-types.d.ts.map +1 -0
- package/dist/autoramp-types.js +2 -0
- package/dist/autoramp-types.js.map +1 -0
- package/dist/{autorampAccount.d.mts → autorampAccount.d.ts} +3 -3
- package/dist/autorampAccount.d.ts.map +1 -0
- package/dist/{autorampAccount.mjs → autorampAccount.js} +1 -1
- package/dist/autorampAccount.js.map +1 -0
- package/dist/{client-identity.d.mts → client-identity.d.ts} +1 -1
- package/dist/client-identity.d.ts.map +1 -0
- package/dist/{client-identity.mjs → client-identity.js} +1 -1
- package/dist/client-identity.js.map +1 -0
- package/dist/{errorNormalization.d.mts → errorNormalization.d.ts} +1 -1
- package/dist/errorNormalization.d.ts.map +1 -0
- package/dist/{errorNormalization.mjs → errorNormalization.js} +1 -1
- package/dist/errorNormalization.js.map +1 -0
- package/dist/{featureFlags.d.mts → featureFlags.d.ts} +2 -2
- package/dist/featureFlags.d.ts.map +1 -0
- package/dist/{featureFlags.mjs → featureFlags.js} +1 -1
- package/dist/featureFlags.js.map +1 -0
- package/dist/{index.d.mts → index.d.ts} +35 -35
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/{orderStatus.d.mts → orderStatus.d.ts} +2 -2
- package/dist/orderStatus.d.ts.map +1 -0
- package/dist/{orderStatus.mjs → orderStatus.js} +2 -2
- package/dist/orderStatus.js.map +1 -0
- package/dist/{ownership-message.d.cts → ownership-message.d.ts} +1 -1
- package/dist/ownership-message.d.ts.map +1 -0
- package/dist/{ownership-message.mjs → ownership-message.js} +1 -1
- package/dist/ownership-message.js.map +1 -0
- package/dist/{paymentMethodMerge.d.cts → paymentMethodMerge.d.ts} +2 -2
- package/dist/paymentMethodMerge.d.ts.map +1 -0
- package/dist/{paymentMethodMerge.mjs → paymentMethodMerge.js} +1 -1
- package/dist/paymentMethodMerge.js.map +1 -0
- package/dist/{providerAvailability.d.cts → providerAvailability.d.ts} +2 -2
- package/dist/providerAvailability.d.ts.map +1 -0
- package/dist/{providerAvailability.mjs → providerAvailability.js} +1 -1
- package/dist/providerAvailability.js.map +1 -0
- package/dist/{quoteClassification.d.cts → quoteClassification.d.ts} +2 -2
- package/dist/quoteClassification.d.ts.map +1 -0
- package/dist/{quoteClassification.mjs → quoteClassification.js} +1 -1
- package/dist/quoteClassification.js.map +1 -0
- package/dist/{rampsErrorCodes.d.cts → rampsErrorCodes.d.ts} +2 -2
- package/dist/rampsErrorCodes.d.ts.map +1 -0
- package/dist/{rampsErrorCodes.mjs → rampsErrorCodes.js} +1 -1
- package/dist/rampsErrorCodes.js.map +1 -0
- package/dist/{selectors.d.mts → selectors.d.ts} +3 -3
- package/dist/selectors.d.ts.map +1 -0
- package/dist/{selectors.mjs → selectors.js} +2 -2
- package/dist/selectors.js.map +1 -0
- package/dist/{transakApiErrorUtils.d.cts → transakApiErrorUtils.d.ts} +1 -1
- package/dist/transakApiErrorUtils.d.ts.map +1 -0
- package/dist/{transakApiErrorUtils.mjs → transakApiErrorUtils.js} +3 -3
- package/dist/transakApiErrorUtils.js.map +1 -0
- package/dist/{transakErrorCodes.d.cts → transakErrorCodes.d.ts} +3 -3
- package/dist/transakErrorCodes.d.ts.map +1 -0
- package/dist/{transakErrorCodes.mjs → transakErrorCodes.js} +1 -1
- package/dist/transakErrorCodes.js.map +1 -0
- package/dist/{wallet-registration-machine.d.cts → wallet-registration-machine.d.ts} +1 -1
- package/dist/wallet-registration-machine.d.ts.map +1 -0
- package/dist/{wallet-registration-machine.mjs → wallet-registration-machine.js} +1 -1
- package/dist/wallet-registration-machine.js.map +1 -0
- package/dist/{wallet-registration-service.d.cts → wallet-registration-service.d.ts} +1 -1
- package/dist/wallet-registration-service.d.ts.map +1 -0
- package/dist/{wallet-registration-service.mjs → wallet-registration-service.js} +60 -69
- package/dist/wallet-registration-service.js.map +1 -0
- package/package.json +17 -21
- package/dist/NeoBankService-method-action-types.cjs +0 -7
- package/dist/NeoBankService-method-action-types.cjs.map +0 -1
- package/dist/NeoBankService-method-action-types.d.cts +0 -126
- package/dist/NeoBankService-method-action-types.d.cts.map +0 -1
- package/dist/NeoBankService-method-action-types.d.mts.map +0 -1
- package/dist/NeoBankService-method-action-types.mjs.map +0 -1
- package/dist/NeoBankService.cjs +0 -387
- package/dist/NeoBankService.cjs.map +0 -1
- package/dist/NeoBankService.d.cts.map +0 -1
- package/dist/NeoBankService.d.mts +0 -191
- package/dist/NeoBankService.d.mts.map +0 -1
- package/dist/NeoBankService.mjs +0 -379
- package/dist/NeoBankService.mjs.map +0 -1
- package/dist/RampsController-method-action-types.cjs +0 -7
- package/dist/RampsController-method-action-types.cjs.map +0 -1
- package/dist/RampsController-method-action-types.d.cts +0 -758
- package/dist/RampsController-method-action-types.d.cts.map +0 -1
- package/dist/RampsController-method-action-types.d.mts.map +0 -1
- package/dist/RampsController-method-action-types.mjs.map +0 -1
- package/dist/RampsController.cjs +0 -2799
- package/dist/RampsController.cjs.map +0 -1
- package/dist/RampsController.d.cts.map +0 -1
- package/dist/RampsController.d.mts +0 -968
- package/dist/RampsController.d.mts.map +0 -1
- package/dist/RampsController.mjs.map +0 -1
- package/dist/RampsService-method-action-types.cjs +0 -7
- package/dist/RampsService-method-action-types.cjs.map +0 -1
- package/dist/RampsService-method-action-types.d.cts.map +0 -1
- package/dist/RampsService-method-action-types.d.mts +0 -171
- package/dist/RampsService-method-action-types.d.mts.map +0 -1
- package/dist/RampsService-method-action-types.mjs.map +0 -1
- package/dist/RampsService.cjs +0 -708
- package/dist/RampsService.cjs.map +0 -1
- package/dist/RampsService.d.cts +0 -944
- package/dist/RampsService.d.cts.map +0 -1
- package/dist/RampsService.d.mts.map +0 -1
- package/dist/RampsService.mjs.map +0 -1
- package/dist/RequestCache.cjs +0 -103
- package/dist/RequestCache.cjs.map +0 -1
- package/dist/RequestCache.d.cts +0 -110
- package/dist/RequestCache.d.cts.map +0 -1
- package/dist/RequestCache.d.mts.map +0 -1
- package/dist/RequestCache.mjs.map +0 -1
- package/dist/TransakService-method-action-types.cjs +0 -7
- package/dist/TransakService-method-action-types.cjs.map +0 -1
- package/dist/TransakService-method-action-types.d.cts.map +0 -1
- package/dist/TransakService-method-action-types.d.mts +0 -140
- package/dist/TransakService-method-action-types.d.mts.map +0 -1
- package/dist/TransakService-method-action-types.mjs.map +0 -1
- package/dist/TransakService.cjs +0 -743
- package/dist/TransakService.cjs.map +0 -1
- package/dist/TransakService.d.cts.map +0 -1
- package/dist/TransakService.d.mts +0 -370
- package/dist/TransakService.d.mts.map +0 -1
- package/dist/TransakService.mjs +0 -734
- package/dist/TransakService.mjs.map +0 -1
- package/dist/autoramp-types.cjs +0 -3
- package/dist/autoramp-types.cjs.map +0 -1
- package/dist/autoramp-types.d.cts.map +0 -1
- package/dist/autoramp-types.d.mts +0 -22
- package/dist/autoramp-types.d.mts.map +0 -1
- package/dist/autoramp-types.mjs +0 -2
- package/dist/autoramp-types.mjs.map +0 -1
- package/dist/autorampAccount.cjs +0 -155
- package/dist/autorampAccount.cjs.map +0 -1
- package/dist/autorampAccount.d.cts +0 -126
- package/dist/autorampAccount.d.cts.map +0 -1
- package/dist/autorampAccount.d.mts.map +0 -1
- package/dist/autorampAccount.mjs.map +0 -1
- package/dist/client-identity.cjs +0 -28
- package/dist/client-identity.cjs.map +0 -1
- package/dist/client-identity.d.cts +0 -24
- package/dist/client-identity.d.cts.map +0 -1
- package/dist/client-identity.d.mts.map +0 -1
- package/dist/client-identity.mjs.map +0 -1
- package/dist/errorNormalization.cjs +0 -84
- package/dist/errorNormalization.cjs.map +0 -1
- package/dist/errorNormalization.d.cts +0 -56
- package/dist/errorNormalization.d.cts.map +0 -1
- package/dist/errorNormalization.d.mts.map +0 -1
- package/dist/errorNormalization.mjs.map +0 -1
- package/dist/featureFlags.cjs +0 -144
- package/dist/featureFlags.cjs.map +0 -1
- package/dist/featureFlags.d.cts +0 -82
- package/dist/featureFlags.d.cts.map +0 -1
- package/dist/featureFlags.d.mts.map +0 -1
- package/dist/featureFlags.mjs.map +0 -1
- package/dist/index.cjs +0 -82
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -35
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -18
- package/dist/index.mjs.map +0 -1
- package/dist/orderStatus.cjs +0 -34
- package/dist/orderStatus.cjs.map +0 -1
- package/dist/orderStatus.d.cts +0 -18
- package/dist/orderStatus.d.cts.map +0 -1
- package/dist/orderStatus.d.mts.map +0 -1
- package/dist/orderStatus.mjs.map +0 -1
- package/dist/ownership-message.cjs +0 -26
- package/dist/ownership-message.cjs.map +0 -1
- package/dist/ownership-message.d.cts.map +0 -1
- package/dist/ownership-message.d.mts +0 -22
- package/dist/ownership-message.d.mts.map +0 -1
- package/dist/ownership-message.mjs.map +0 -1
- package/dist/paymentMethodMerge.cjs +0 -51
- package/dist/paymentMethodMerge.cjs.map +0 -1
- package/dist/paymentMethodMerge.d.cts.map +0 -1
- package/dist/paymentMethodMerge.d.mts +0 -26
- package/dist/paymentMethodMerge.d.mts.map +0 -1
- package/dist/paymentMethodMerge.mjs.map +0 -1
- package/dist/providerAvailability.cjs +0 -134
- package/dist/providerAvailability.cjs.map +0 -1
- package/dist/providerAvailability.d.cts.map +0 -1
- package/dist/providerAvailability.d.mts +0 -101
- package/dist/providerAvailability.d.mts.map +0 -1
- package/dist/providerAvailability.mjs.map +0 -1
- package/dist/quoteClassification.cjs +0 -44
- package/dist/quoteClassification.cjs.map +0 -1
- package/dist/quoteClassification.d.cts.map +0 -1
- package/dist/quoteClassification.d.mts +0 -33
- package/dist/quoteClassification.d.mts.map +0 -1
- package/dist/quoteClassification.mjs.map +0 -1
- package/dist/rampsErrorCodes.cjs +0 -11
- package/dist/rampsErrorCodes.cjs.map +0 -1
- package/dist/rampsErrorCodes.d.cts.map +0 -1
- package/dist/rampsErrorCodes.d.mts +0 -9
- package/dist/rampsErrorCodes.d.mts.map +0 -1
- package/dist/rampsErrorCodes.mjs.map +0 -1
- package/dist/selectors.cjs +0 -85
- package/dist/selectors.cjs.map +0 -1
- package/dist/selectors.d.cts +0 -78
- package/dist/selectors.d.cts.map +0 -1
- package/dist/selectors.d.mts.map +0 -1
- package/dist/selectors.mjs.map +0 -1
- package/dist/transakApiErrorUtils.cjs +0 -15
- package/dist/transakApiErrorUtils.cjs.map +0 -1
- package/dist/transakApiErrorUtils.d.cts.map +0 -1
- package/dist/transakApiErrorUtils.d.mts +0 -3
- package/dist/transakApiErrorUtils.d.mts.map +0 -1
- package/dist/transakApiErrorUtils.mjs.map +0 -1
- package/dist/transakErrorCodes.cjs +0 -14
- package/dist/transakErrorCodes.cjs.map +0 -1
- package/dist/transakErrorCodes.d.cts.map +0 -1
- package/dist/transakErrorCodes.d.mts +0 -12
- package/dist/transakErrorCodes.d.mts.map +0 -1
- package/dist/transakErrorCodes.mjs.map +0 -1
- package/dist/wallet-registration-machine.cjs +0 -144
- package/dist/wallet-registration-machine.cjs.map +0 -1
- package/dist/wallet-registration-machine.d.cts.map +0 -1
- package/dist/wallet-registration-machine.d.mts +0 -81
- package/dist/wallet-registration-machine.d.mts.map +0 -1
- package/dist/wallet-registration-machine.mjs.map +0 -1
- package/dist/wallet-registration-service.cjs +0 -351
- package/dist/wallet-registration-service.cjs.map +0 -1
- package/dist/wallet-registration-service.d.cts.map +0 -1
- package/dist/wallet-registration-service.d.mts +0 -144
- package/dist/wallet-registration-service.d.mts.map +0 -1
- package/dist/wallet-registration-service.mjs.map +0 -1
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is auto generated.
|
|
3
|
-
* Do not edit manually.
|
|
4
|
-
*/
|
|
5
|
-
import type { RampsService } from "./RampsService.mjs";
|
|
6
|
-
/**
|
|
7
|
-
* Returns the default redirect ("fake callback") URL for this service's
|
|
8
|
-
* environment.
|
|
9
|
-
*
|
|
10
|
-
* The quotes API only embeds a `buyURL`/`buyWidget` (the WebView page a
|
|
11
|
-
* non-native provider needs) when a `redirectUrl` is present, so callers
|
|
12
|
-
* that omit one (MM Pay's widened Headless Buy fetch) use this value.
|
|
13
|
-
* Exposing it here makes the service's environment the single runtime source
|
|
14
|
-
* of truth, so the callback can never point at a different environment than
|
|
15
|
-
* the one the quotes themselves came from.
|
|
16
|
-
*
|
|
17
|
-
* `baseUrlOverride` deliberately does not apply. That option overrides the
|
|
18
|
-
* ramps API base URL for local development. In production and staging the
|
|
19
|
-
* callback lives on a different host (`on-ramp-content` versus
|
|
20
|
-
* `on-ramp{-cache}`), so an API override says nothing about where
|
|
21
|
-
* `/regions/fake-callback` lives. In development the callback already shares
|
|
22
|
-
* the API host family (`on-ramp.dev-api`). The redirect URL is also handed
|
|
23
|
-
* to the provider and matched by client UI to detect flow completion, so
|
|
24
|
-
* returning an unrelated local API origin here would break completion
|
|
25
|
-
* detection rather than help it. Point `environment` at
|
|
26
|
-
* {@link RampsEnvironment.Local} for a localhost callback, noting that URL
|
|
27
|
-
* is pinned to `http://localhost:3000` and does not follow a non-3000
|
|
28
|
-
* `baseUrlOverride`.
|
|
29
|
-
*
|
|
30
|
-
* @returns The default redirect callback URL for the configured environment.
|
|
31
|
-
*/
|
|
32
|
-
export type RampsServiceGetDefaultRedirectCallbackUrlAction = {
|
|
33
|
-
type: `RampsService:getDefaultRedirectCallbackUrl`;
|
|
34
|
-
handler: RampsService['getDefaultRedirectCallbackUrl'];
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Makes a request to the API in order to retrieve the user's geolocation
|
|
38
|
-
* based on their IP address.
|
|
39
|
-
*
|
|
40
|
-
* @returns The user's country/region code (e.g., "US-UT" for Utah, USA).
|
|
41
|
-
*/
|
|
42
|
-
export type RampsServiceGetGeolocationAction = {
|
|
43
|
-
type: `RampsService:getGeolocation`;
|
|
44
|
-
handler: RampsService['getGeolocation'];
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Makes a request to the cached API to retrieve the list of supported countries.
|
|
48
|
-
* The API returns countries with support information for both buy and sell actions.
|
|
49
|
-
* Filters countries based on aggregator support (preserves OnRampSDK logic).
|
|
50
|
-
*
|
|
51
|
-
* @returns An array of countries filtered by aggregator support.
|
|
52
|
-
*/
|
|
53
|
-
export type RampsServiceGetCountriesAction = {
|
|
54
|
-
type: `RampsService:getCountries`;
|
|
55
|
-
handler: RampsService['getCountries'];
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* Fetches the list of available tokens for a given region and action.
|
|
59
|
-
* Supports optional provider filter.
|
|
60
|
-
*
|
|
61
|
-
* @param region - The region code (e.g., "us", "fr", "us-ny").
|
|
62
|
-
* @param action - The ramp action type ('buy' or 'sell').
|
|
63
|
-
* @param options - Optional query parameters for filtering tokens.
|
|
64
|
-
* @param options.provider - Provider ID(s) to filter by.
|
|
65
|
-
* @returns The tokens response containing topTokens and allTokens.
|
|
66
|
-
*/
|
|
67
|
-
export type RampsServiceGetTokensAction = {
|
|
68
|
-
type: `RampsService:getTokens`;
|
|
69
|
-
handler: RampsService['getTokens'];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Fetches the list of providers for a given region.
|
|
73
|
-
* Supports optional query filters: provider, crypto, payments.
|
|
74
|
-
* Region local fiat filtering is applied server-side when `fiat` is omitted.
|
|
75
|
-
*
|
|
76
|
-
* @param regionCode - The region code (e.g., "us", "fr", "us-ny").
|
|
77
|
-
* @param options - Optional query parameters for filtering providers.
|
|
78
|
-
* @param options.provider - Provider ID(s) to filter by.
|
|
79
|
-
* @param options.crypto - Crypto currency ID(s) to filter by.
|
|
80
|
-
* @param options.payments - Payment method ID(s) to filter by.
|
|
81
|
-
* @returns The providers response containing providers array.
|
|
82
|
-
*/
|
|
83
|
-
export type RampsServiceGetProvidersAction = {
|
|
84
|
-
type: `RampsService:getProviders`;
|
|
85
|
-
handler: RampsService['getProviders'];
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Fetches the list of payment methods for a given region, asset, and provider.
|
|
89
|
-
*
|
|
90
|
-
* Region local fiat filtering is applied server-side when `fiat` is omitted.
|
|
91
|
-
*
|
|
92
|
-
* @param options - Query parameters for filtering payment methods.
|
|
93
|
-
* @param options.region - User's region code (e.g., "us-al").
|
|
94
|
-
* @param options.assetId - CAIP-19 cryptocurrency identifier.
|
|
95
|
-
* @param options.provider - Provider ID path.
|
|
96
|
-
* @returns The payment methods response containing payments array.
|
|
97
|
-
*/
|
|
98
|
-
export type RampsServiceGetPaymentMethodsAction = {
|
|
99
|
-
type: `RampsService:getPaymentMethods`;
|
|
100
|
-
handler: RampsService['getPaymentMethods'];
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Fetches quotes from all providers for a given set of parameters.
|
|
104
|
-
* Uses the V2 orders API to get quotes for multiple payment methods at once.
|
|
105
|
-
*
|
|
106
|
-
* @param params - The parameters for fetching quotes.
|
|
107
|
-
* @param params.region - User's region code (e.g., "us", "us-ca").
|
|
108
|
-
* @param params.paymentMethods - Array of payment method IDs.
|
|
109
|
-
* @param params.assetId - CAIP-19 cryptocurrency identifier.
|
|
110
|
-
* @param params.fiat - Fiat currency code (e.g., "usd").
|
|
111
|
-
* @param params.amount - The amount (in fiat for buy, crypto for sell).
|
|
112
|
-
* @param params.walletAddress - The destination wallet address.
|
|
113
|
-
* @param params.redirectUrl - Optional redirect URL after order completion.
|
|
114
|
-
* @param params.providers - Optional provider IDs to filter quotes.
|
|
115
|
-
* @param params.action - The ramp action type. Defaults to 'buy'.
|
|
116
|
-
* @returns The quotes response containing success, sorted, error, and customActions.
|
|
117
|
-
*/
|
|
118
|
-
export type RampsServiceGetQuotesAction = {
|
|
119
|
-
type: `RampsService:getQuotes`;
|
|
120
|
-
handler: RampsService['getQuotes'];
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* Fetches the buy widget data from a buy URL endpoint.
|
|
124
|
-
* Makes a request to the buyURL (as provided in a quote) to get the actual
|
|
125
|
-
* provider widget URL, browser type, and order ID.
|
|
126
|
-
*
|
|
127
|
-
* @param buyUrl - The full buy URL endpoint to fetch from.
|
|
128
|
-
* @returns The buy widget data containing the provider widget URL.
|
|
129
|
-
*/
|
|
130
|
-
export type RampsServiceGetBuyWidgetUrlAction = {
|
|
131
|
-
type: `RampsService:getBuyWidgetUrl`;
|
|
132
|
-
handler: RampsService['getBuyWidgetUrl'];
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Fetches an order from the unified V2 API endpoint.
|
|
136
|
-
* This endpoint returns a normalized `RampsOrder` (DepositOrder shape)
|
|
137
|
-
* for all provider types, including both aggregator and native providers.
|
|
138
|
-
*
|
|
139
|
-
* @param providerCode - The provider code (e.g., "transak", "transak-native", "moonpay"),
|
|
140
|
-
* with or without the `/providers/` prefix.
|
|
141
|
-
* @param orderCode - The order identifier.
|
|
142
|
-
* @param wallet - The wallet address associated with the order.
|
|
143
|
-
* @returns The unified order data.
|
|
144
|
-
*/
|
|
145
|
-
export type RampsServiceGetOrderAction = {
|
|
146
|
-
type: `RampsService:getOrder`;
|
|
147
|
-
handler: RampsService['getOrder'];
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Extracts an order from a provider callback URL.
|
|
151
|
-
* Sends the callback URL to the V2 API backend, which knows how to parse
|
|
152
|
-
* each provider's callback format and extract the order ID. Then fetches
|
|
153
|
-
* the full order using that ID.
|
|
154
|
-
*
|
|
155
|
-
* This is the V2 equivalent of the aggregator SDK's `getOrderFromCallback`.
|
|
156
|
-
*
|
|
157
|
-
* @param providerCode - The provider code (e.g., "transak", "moonpay"),
|
|
158
|
-
* with or without the `/providers/` prefix.
|
|
159
|
-
* @param callbackUrl - The full callback URL the provider redirected to.
|
|
160
|
-
* @param wallet - The wallet address associated with the order.
|
|
161
|
-
* @returns The unified order data.
|
|
162
|
-
*/
|
|
163
|
-
export type RampsServiceGetOrderFromCallbackAction = {
|
|
164
|
-
type: `RampsService:getOrderFromCallback`;
|
|
165
|
-
handler: RampsService['getOrderFromCallback'];
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* Union of all RampsService action types.
|
|
169
|
-
*/
|
|
170
|
-
export type RampsServiceMethodActions = RampsServiceGetDefaultRedirectCallbackUrlAction | RampsServiceGetGeolocationAction | RampsServiceGetCountriesAction | RampsServiceGetTokensAction | RampsServiceGetProvidersAction | RampsServiceGetPaymentMethodsAction | RampsServiceGetQuotesAction | RampsServiceGetBuyWidgetUrlAction | RampsServiceGetOrderAction | RampsServiceGetOrderFromCallbackAction;
|
|
171
|
-
//# sourceMappingURL=RampsService-method-action-types.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RampsService-method-action-types.d.mts","sourceRoot":"","sources":["../src/RampsService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA0B;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,YAAY,CAAC,mBAAmB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,+CAA+C,GAC/C,gCAAgC,GAChC,8BAA8B,GAC9B,2BAA2B,GAC3B,8BAA8B,GAC9B,mCAAmC,GACnC,2BAA2B,GAC3B,iCAAiC,GACjC,0BAA0B,GAC1B,sCAAsC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RampsService-method-action-types.mjs","sourceRoot":"","sources":["../src/RampsService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsService } from './RampsService.js';\n\n/**\n * Returns the default redirect (\"fake callback\") URL for this service's\n * environment.\n *\n * The quotes API only embeds a `buyURL`/`buyWidget` (the WebView page a\n * non-native provider needs) when a `redirectUrl` is present, so callers\n * that omit one (MM Pay's widened Headless Buy fetch) use this value.\n * Exposing it here makes the service's environment the single runtime source\n * of truth, so the callback can never point at a different environment than\n * the one the quotes themselves came from.\n *\n * `baseUrlOverride` deliberately does not apply. That option overrides the\n * ramps API base URL for local development. In production and staging the\n * callback lives on a different host (`on-ramp-content` versus\n * `on-ramp{-cache}`), so an API override says nothing about where\n * `/regions/fake-callback` lives. In development the callback already shares\n * the API host family (`on-ramp.dev-api`). The redirect URL is also handed\n * to the provider and matched by client UI to detect flow completion, so\n * returning an unrelated local API origin here would break completion\n * detection rather than help it. Point `environment` at\n * {@link RampsEnvironment.Local} for a localhost callback, noting that URL\n * is pinned to `http://localhost:3000` and does not follow a non-3000\n * `baseUrlOverride`.\n *\n * @returns The default redirect callback URL for the configured environment.\n */\nexport type RampsServiceGetDefaultRedirectCallbackUrlAction = {\n type: `RampsService:getDefaultRedirectCallbackUrl`;\n handler: RampsService['getDefaultRedirectCallbackUrl'];\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 */\nexport type RampsServiceGetGeolocationAction = {\n type: `RampsService:getGeolocation`;\n handler: RampsService['getGeolocation'];\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 */\nexport type RampsServiceGetCountriesAction = {\n type: `RampsService:getCountries`;\n handler: RampsService['getCountries'];\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 */\nexport type RampsServiceGetTokensAction = {\n type: `RampsService:getTokens`;\n handler: RampsService['getTokens'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * Supports optional query filters: provider, crypto, payments.\n * Region local fiat filtering is applied server-side when `fiat` is omitted.\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.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsServiceGetProvidersAction = {\n type: `RampsService:getProviders`;\n handler: RampsService['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given region, asset, and provider.\n *\n * Region local fiat filtering is applied server-side when `fiat` is omitted.\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.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsServiceGetPaymentMethodsAction = {\n type: `RampsService:getPaymentMethods`;\n handler: RampsService['getPaymentMethods'];\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 */\nexport type RampsServiceGetQuotesAction = {\n type: `RampsService:getQuotes`;\n handler: RampsService['getQuotes'];\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 */\nexport type RampsServiceGetBuyWidgetUrlAction = {\n type: `RampsService:getBuyWidgetUrl`;\n handler: RampsService['getBuyWidgetUrl'];\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 * with or without the `/providers/` prefix.\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 RampsServiceGetOrderAction = {\n type: `RampsService:getOrder`;\n handler: RampsService['getOrder'];\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 * with or without the `/providers/` prefix.\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 RampsServiceGetOrderFromCallbackAction = {\n type: `RampsService:getOrderFromCallback`;\n handler: RampsService['getOrderFromCallback'];\n};\n\n/**\n * Union of all RampsService action types.\n */\nexport type RampsServiceMethodActions =\n | RampsServiceGetDefaultRedirectCallbackUrlAction\n | RampsServiceGetGeolocationAction\n | RampsServiceGetCountriesAction\n | RampsServiceGetTokensAction\n | RampsServiceGetProvidersAction\n | RampsServiceGetPaymentMethodsAction\n | RampsServiceGetQuotesAction\n | RampsServiceGetBuyWidgetUrlAction\n | RampsServiceGetOrderAction\n | RampsServiceGetOrderFromCallbackAction;\n"]}
|