@metamask/ramps-controller 11.0.0 → 12.0.1

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.
@@ -0,0 +1,562 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ import type { RampsController } from "./RampsController.cjs";
6
+ /**
7
+ * Executes a request with caching, deduplication, and at most one in-flight
8
+ * request per resource type.
9
+ *
10
+ * 1. **Same cache key in flight** – If a request with this cache key is
11
+ * already pending, returns that promise (deduplication; no second request).
12
+ *
13
+ * 2. **Cache hit** – If valid, non-expired data exists in state.requests for
14
+ * this key and forceRefresh is not set, returns that data without fetching.
15
+ *
16
+ * 3. **New request** – Creates an AbortController and fires the fetcher.
17
+ * If options.resourceType is set, tags the pending request with that
18
+ * resource type (so #abortDependentRequests can cancel it on region
19
+ * change or cleanup) and ref-counts resource-level loading state.
20
+ * On success or error, updates request state and resource error;
21
+ * in finally, clears resource loading only if this request was not
22
+ * aborted.
23
+ *
24
+ * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).
25
+ * @param fetcher - Async function that performs the fetch. Receives an AbortSignal
26
+ * that is aborted when this request is superseded by another for the same resource.
27
+ * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.
28
+ * @returns The result of the request (from cache, joined promise, or fetcher).
29
+ */
30
+ export type RampsControllerExecuteRequestAction = {
31
+ type: `RampsController:executeRequest`;
32
+ handler: RampsController['executeRequest'];
33
+ };
34
+ /**
35
+ * Aborts a pending request if one exists.
36
+ *
37
+ * @param cacheKey - The cache key of the request to abort.
38
+ * @returns True if a request was aborted.
39
+ */
40
+ export type RampsControllerAbortRequestAction = {
41
+ type: `RampsController:abortRequest`;
42
+ handler: RampsController['abortRequest'];
43
+ };
44
+ /**
45
+ * Gets the state of a specific cached request.
46
+ *
47
+ * @param cacheKey - The cache key to look up.
48
+ * @returns The request state, or undefined if not cached.
49
+ */
50
+ export type RampsControllerGetRequestStateAction = {
51
+ type: `RampsController:getRequestState`;
52
+ handler: RampsController['getRequestState'];
53
+ };
54
+ /**
55
+ * Sets the user's region manually (without fetching geolocation).
56
+ * This allows users to override the detected region.
57
+ *
58
+ * @param region - The region code to set (e.g., "US-CA").
59
+ * @param options - Options for cache behavior.
60
+ * @returns The user region object.
61
+ */
62
+ export type RampsControllerSetUserRegionAction = {
63
+ type: `RampsController:setUserRegion`;
64
+ handler: RampsController['setUserRegion'];
65
+ };
66
+ /**
67
+ * Sets the user's selected provider by ID, or clears the selection.
68
+ * Looks up the provider from the current providers in state and automatically
69
+ * fetches payment methods for that provider.
70
+ *
71
+ * @param providerId - The provider ID (e.g., "/providers/moonpay"), or null to clear.
72
+ * @throws If region is not set, providers are not loaded, or provider is not found.
73
+ */
74
+ export type RampsControllerSetSelectedProviderAction = {
75
+ type: `RampsController:setSelectedProvider`;
76
+ handler: RampsController['setSelectedProvider'];
77
+ };
78
+ /**
79
+ * Initializes the controller by fetching the user's region from geolocation.
80
+ * This should be called once at app startup to set up the initial region.
81
+ *
82
+ * Idempotent: subsequent calls return the same promise unless forceRefresh is set.
83
+ * Skips getCountries when countries are already loaded; skips geolocation when
84
+ * userRegion already exists.
85
+ *
86
+ * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.
87
+ * @returns Promise that resolves when initialization is complete.
88
+ */
89
+ export type RampsControllerInitAction = {
90
+ type: `RampsController:init`;
91
+ handler: RampsController['init'];
92
+ };
93
+ /**
94
+ * Fetches the list of supported countries.
95
+ * The API returns countries with support information for both buy and sell actions.
96
+ * The countries are saved in the controller state once fetched.
97
+ *
98
+ * @param options - Options for cache behavior.
99
+ * @returns An array of countries.
100
+ */
101
+ export type RampsControllerGetCountriesAction = {
102
+ type: `RampsController:getCountries`;
103
+ handler: RampsController['getCountries'];
104
+ };
105
+ /**
106
+ * Fetches the list of available tokens for a given region and action.
107
+ * The tokens are saved in the controller state once fetched.
108
+ *
109
+ * @param region - The region code (e.g., "us", "fr", "us-ny"). If not provided, uses the user's region from controller state.
110
+ * @param action - The ramp action type ('buy' or 'sell').
111
+ * @param options - Options for cache behavior and query filters.
112
+ * @param options.provider - Provider ID(s) to filter by.
113
+ * @returns The tokens response containing topTokens and allTokens.
114
+ */
115
+ export type RampsControllerGetTokensAction = {
116
+ type: `RampsController:getTokens`;
117
+ handler: RampsController['getTokens'];
118
+ };
119
+ /**
120
+ * Sets the user's selected token by asset ID.
121
+ * Looks up the token from the current tokens in state and automatically
122
+ * fetches payment methods for that token.
123
+ *
124
+ * @param assetId - The asset identifier in CAIP-19 format (e.g., "eip155:1/erc20:0x..."), or undefined to clear.
125
+ * @throws If region is not set, tokens are not loaded, or token is not found.
126
+ */
127
+ export type RampsControllerSetSelectedTokenAction = {
128
+ type: `RampsController:setSelectedToken`;
129
+ handler: RampsController['setSelectedToken'];
130
+ };
131
+ /**
132
+ * Fetches the list of providers for a given region.
133
+ * The providers are saved in the controller state once fetched.
134
+ *
135
+ * @param region - The region code (e.g., "us", "fr", "us-ny"). If not provided, uses the user's region from controller state.
136
+ * @param options - Options for cache behavior and query filters.
137
+ * @param options.provider - Provider ID(s) to filter by.
138
+ * @param options.crypto - Crypto currency ID(s) to filter by.
139
+ * @param options.fiat - Fiat currency ID(s) to filter by.
140
+ * @param options.payments - Payment method ID(s) to filter by.
141
+ * @returns The providers response containing providers array.
142
+ */
143
+ export type RampsControllerGetProvidersAction = {
144
+ type: `RampsController:getProviders`;
145
+ handler: RampsController['getProviders'];
146
+ };
147
+ /**
148
+ * Fetches the list of payment methods for a given context.
149
+ * The payment methods are saved in the controller state once fetched.
150
+ *
151
+ * @param region - User's region code (e.g. "fr", "us-ny").
152
+ * @param options - Query parameters for filtering payment methods.
153
+ * @param options.fiat - Fiat currency code (e.g., "usd"). If not provided, uses the user's region currency.
154
+ * @param options.assetId - CAIP-19 cryptocurrency identifier.
155
+ * @param options.provider - Provider ID path.
156
+ * @returns The payment methods response containing payments array.
157
+ */
158
+ export type RampsControllerGetPaymentMethodsAction = {
159
+ type: `RampsController:getPaymentMethods`;
160
+ handler: RampsController['getPaymentMethods'];
161
+ };
162
+ /**
163
+ * Sets the user's selected payment method by ID.
164
+ * Looks up the payment method from the current payment methods in state.
165
+ *
166
+ * @param paymentMethodId - The payment method ID (e.g., "/payments/debit-credit-card"), or null to clear.
167
+ * @throws If payment methods are not loaded or payment method is not found.
168
+ */
169
+ export type RampsControllerSetSelectedPaymentMethodAction = {
170
+ type: `RampsController:setSelectedPaymentMethod`;
171
+ handler: RampsController['setSelectedPaymentMethod'];
172
+ };
173
+ /**
174
+ * Fetches quotes from all providers for a given set of parameters.
175
+ * Uses the controller's request cache; callers manage the response in local state.
176
+ *
177
+ * @param options - The parameters for fetching quotes.
178
+ * @param options.region - User's region code. If not provided, uses userRegion from state.
179
+ * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.
180
+ * @param options.assetId - CAIP-19 cryptocurrency identifier.
181
+ * @param options.amount - The amount (in fiat for buy, crypto for sell).
182
+ * @param options.walletAddress - The destination wallet address.
183
+ * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.
184
+ * @param options.providers - Optional provider IDs to filter quotes.
185
+ * @param options.redirectUrl - Optional redirect URL after order completion.
186
+ * @param options.action - The ramp action type. Defaults to 'buy'.
187
+ * @param options.forceRefresh - Whether to bypass cache.
188
+ * @param options.ttl - Custom TTL for this request.
189
+ * @returns The quotes response containing success, sorted, error, and customActions.
190
+ */
191
+ export type RampsControllerGetQuotesAction = {
192
+ type: `RampsController:getQuotes`;
193
+ handler: RampsController['getQuotes'];
194
+ };
195
+ /**
196
+ * Adds or updates a V2 order in controller state.
197
+ * If an order with the same providerOrderId already exists, the incoming
198
+ * fields are merged on top of the existing order so that fields not present
199
+ * in the update (e.g. paymentDetails from the Transak API) are preserved.
200
+ *
201
+ * @param order - The RampsOrder to add or update.
202
+ */
203
+ export type RampsControllerAddOrderAction = {
204
+ type: `RampsController:addOrder`;
205
+ handler: RampsController['addOrder'];
206
+ };
207
+ /**
208
+ * Removes a V2 order from controller state by providerOrderId.
209
+ *
210
+ * @param providerOrderId - The provider order ID to remove.
211
+ */
212
+ export type RampsControllerRemoveOrderAction = {
213
+ type: `RampsController:removeOrder`;
214
+ handler: RampsController['removeOrder'];
215
+ };
216
+ /**
217
+ * Starts polling all pending V2 orders at a fixed interval.
218
+ * Each poll cycle iterates orders with non-terminal statuses,
219
+ * respects pollingSecondsMinimum and backoff from error count.
220
+ */
221
+ export type RampsControllerStartOrderPollingAction = {
222
+ type: `RampsController:startOrderPolling`;
223
+ handler: RampsController['startOrderPolling'];
224
+ };
225
+ /**
226
+ * Stops order polling and clears the interval.
227
+ */
228
+ export type RampsControllerStopOrderPollingAction = {
229
+ type: `RampsController:stopOrderPolling`;
230
+ handler: RampsController['stopOrderPolling'];
231
+ };
232
+ /**
233
+ * Fetches the widget data from a quote for redirect providers.
234
+ * Makes a request to the buyURL endpoint via the RampsService to get the
235
+ * actual provider widget URL and optional order ID for polling.
236
+ *
237
+ * @param quote - The quote to fetch the widget URL from.
238
+ * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).
239
+ * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.
240
+ */
241
+ export type RampsControllerGetBuyWidgetDataAction = {
242
+ type: `RampsController:getBuyWidgetData`;
243
+ handler: RampsController['getBuyWidgetData'];
244
+ };
245
+ /**
246
+ * Registers an order ID for polling until the order is created or resolved.
247
+ * Adds a minimal stub order to controller state; the existing order polling
248
+ * will fetch the full order when the provider has created it.
249
+ *
250
+ * @param params - Object containing order identifiers and wallet info.
251
+ * @param params.orderId - Full order ID (e.g. "/providers/paypal/orders/abc123") or order code.
252
+ * @param params.providerCode - Provider code (e.g. "paypal", "transak"), with or without /providers/ prefix.
253
+ * @param params.walletAddress - Wallet address for the order.
254
+ * @param params.chainId - Optional chain ID for the order.
255
+ */
256
+ export type RampsControllerAddPrecreatedOrderAction = {
257
+ type: `RampsController:addPrecreatedOrder`;
258
+ handler: RampsController['addPrecreatedOrder'];
259
+ };
260
+ /**
261
+ * Fetches an order from the unified V2 API endpoint.
262
+ * Returns a normalized RampsOrder for all provider types (aggregator and native).
263
+ *
264
+ * @param providerCode - The provider code (e.g., "transak", "transak-native", "moonpay").
265
+ * @param orderCode - The order identifier.
266
+ * @param wallet - The wallet address associated with the order.
267
+ * @returns The unified order data.
268
+ */
269
+ export type RampsControllerGetOrderAction = {
270
+ type: `RampsController:getOrder`;
271
+ handler: RampsController['getOrder'];
272
+ };
273
+ /**
274
+ * Extracts an order from a provider callback URL.
275
+ * Sends the callback URL to the V2 backend for provider-specific parsing,
276
+ * then fetches the full order. This is the V2 equivalent of the aggregator
277
+ * SDK's `getOrderFromCallback`.
278
+ *
279
+ * @param providerCode - The provider code (e.g., "transak", "moonpay").
280
+ * @param callbackUrl - The full callback URL the provider redirected to.
281
+ * @param wallet - The wallet address associated with the order.
282
+ * @returns The unified order data.
283
+ */
284
+ export type RampsControllerGetOrderFromCallbackAction = {
285
+ type: `RampsController:getOrderFromCallback`;
286
+ handler: RampsController['getOrderFromCallback'];
287
+ };
288
+ /**
289
+ * Sets the Transak API key used for all Transak API requests.
290
+ *
291
+ * @param apiKey - The Transak API key.
292
+ */
293
+ export type RampsControllerTransakSetApiKeyAction = {
294
+ type: `RampsController:transakSetApiKey`;
295
+ handler: RampsController['transakSetApiKey'];
296
+ };
297
+ /**
298
+ * Sets the Transak access token and marks the user as authenticated.
299
+ *
300
+ * @param token - The access token received from Transak auth.
301
+ */
302
+ export type RampsControllerTransakSetAccessTokenAction = {
303
+ type: `RampsController:transakSetAccessToken`;
304
+ handler: RampsController['transakSetAccessToken'];
305
+ };
306
+ /**
307
+ * Clears the Transak access token and marks the user as unauthenticated.
308
+ */
309
+ export type RampsControllerTransakClearAccessTokenAction = {
310
+ type: `RampsController:transakClearAccessToken`;
311
+ handler: RampsController['transakClearAccessToken'];
312
+ };
313
+ /**
314
+ * Updates the Transak authentication flag in controller state.
315
+ *
316
+ * @param isAuthenticated - Whether the user is authenticated with Transak.
317
+ */
318
+ export type RampsControllerTransakSetAuthenticatedAction = {
319
+ type: `RampsController:transakSetAuthenticated`;
320
+ handler: RampsController['transakSetAuthenticated'];
321
+ };
322
+ /**
323
+ * Resets all Transak state back to defaults (unauthenticated, no data).
324
+ */
325
+ export type RampsControllerTransakResetStateAction = {
326
+ type: `RampsController:transakResetState`;
327
+ handler: RampsController['transakResetState'];
328
+ };
329
+ /**
330
+ * Sends a one-time password to the user's email for Transak authentication.
331
+ *
332
+ * @param email - The user's email address.
333
+ * @returns The OTP response containing a state token for verification.
334
+ */
335
+ export type RampsControllerTransakSendUserOtpAction = {
336
+ type: `RampsController:transakSendUserOtp`;
337
+ handler: RampsController['transakSendUserOtp'];
338
+ };
339
+ /**
340
+ * Verifies a one-time password and authenticates the user with Transak.
341
+ * Updates the controller's authentication state on success.
342
+ *
343
+ * @param email - The user's email address.
344
+ * @param verificationCode - The OTP code entered by the user.
345
+ * @param stateToken - The state token from the sendUserOtp response.
346
+ * @returns The access token for subsequent authenticated requests.
347
+ */
348
+ export type RampsControllerTransakVerifyUserOtpAction = {
349
+ type: `RampsController:transakVerifyUserOtp`;
350
+ handler: RampsController['transakVerifyUserOtp'];
351
+ };
352
+ /**
353
+ * Logs the user out of Transak. Clears authentication state and user details
354
+ * regardless of whether the API call succeeds or fails.
355
+ *
356
+ * @returns A message indicating the logout result.
357
+ */
358
+ export type RampsControllerTransakLogoutAction = {
359
+ type: `RampsController:transakLogout`;
360
+ handler: RampsController['transakLogout'];
361
+ };
362
+ /**
363
+ * Fetches the authenticated user's details from Transak.
364
+ * Updates the userDetails resource state with loading/success/error states.
365
+ *
366
+ * @returns The user's profile and KYC details.
367
+ */
368
+ export type RampsControllerTransakGetUserDetailsAction = {
369
+ type: `RampsController:transakGetUserDetails`;
370
+ handler: RampsController['transakGetUserDetails'];
371
+ };
372
+ /**
373
+ * Fetches a buy quote from Transak for the given parameters.
374
+ * Updates the buyQuote resource state with loading/success/error states.
375
+ *
376
+ * @param fiatCurrency - The fiat currency code (e.g., "USD").
377
+ * @param cryptoCurrency - The cryptocurrency identifier.
378
+ * @param network - The blockchain network identifier.
379
+ * @param paymentMethod - The payment method identifier.
380
+ * @param fiatAmount - The fiat amount as a string.
381
+ * @returns The buy quote with pricing and fee details.
382
+ */
383
+ export type RampsControllerTransakGetBuyQuoteAction = {
384
+ type: `RampsController:transakGetBuyQuote`;
385
+ handler: RampsController['transakGetBuyQuote'];
386
+ };
387
+ /**
388
+ * Fetches the KYC requirement for a given quote.
389
+ * Updates the kycRequirement resource state with loading/success/error states.
390
+ *
391
+ * @param quoteId - The quote ID to check KYC requirements for.
392
+ * @returns The KYC requirement status and whether the user can place an order.
393
+ */
394
+ export type RampsControllerTransakGetKycRequirementAction = {
395
+ type: `RampsController:transakGetKycRequirement`;
396
+ handler: RampsController['transakGetKycRequirement'];
397
+ };
398
+ /**
399
+ * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.
400
+ *
401
+ * @param quoteId - The quote ID to check additional requirements for.
402
+ * @returns The list of additional forms required.
403
+ */
404
+ export type RampsControllerTransakGetAdditionalRequirementsAction = {
405
+ type: `RampsController:transakGetAdditionalRequirements`;
406
+ handler: RampsController['transakGetAdditionalRequirements'];
407
+ };
408
+ /**
409
+ * Creates a new order on Transak. If an existing order conflicts (HTTP 409),
410
+ * active orders are cancelled and the creation is retried.
411
+ *
412
+ * @param quoteId - The quote ID to create an order from.
413
+ * @param walletAddress - The destination wallet address.
414
+ * @param paymentMethodId - The payment method to use.
415
+ * @returns The created deposit order.
416
+ */
417
+ export type RampsControllerTransakCreateOrderAction = {
418
+ type: `RampsController:transakCreateOrder`;
419
+ handler: RampsController['transakCreateOrder'];
420
+ };
421
+ /**
422
+ * Fetches an existing order from Transak by order ID.
423
+ *
424
+ * @param orderId - The order ID (deposit format or raw Transak format).
425
+ * @param wallet - The wallet address associated with the order.
426
+ * @param paymentDetails - Optional payment details to attach to the order.
427
+ * @returns The deposit order details.
428
+ */
429
+ export type RampsControllerTransakGetOrderAction = {
430
+ type: `RampsController:transakGetOrder`;
431
+ handler: RampsController['transakGetOrder'];
432
+ };
433
+ /**
434
+ * Fetches the user's spending limits for a given currency and payment method.
435
+ *
436
+ * @param fiatCurrency - The fiat currency code.
437
+ * @param paymentMethod - The payment method identifier.
438
+ * @param kycType - The KYC level type.
439
+ * @returns The user's limits, spending, and remaining amounts.
440
+ */
441
+ export type RampsControllerTransakGetUserLimitsAction = {
442
+ type: `RampsController:transakGetUserLimits`;
443
+ handler: RampsController['transakGetUserLimits'];
444
+ };
445
+ /**
446
+ * Requests a one-time token (OTT) for the Transak payment widget.
447
+ *
448
+ * @returns The OTT response containing the token.
449
+ */
450
+ export type RampsControllerTransakRequestOttAction = {
451
+ type: `RampsController:transakRequestOtt`;
452
+ handler: RampsController['transakRequestOtt'];
453
+ };
454
+ /**
455
+ * Generates a URL for the Transak payment widget with pre-filled parameters.
456
+ *
457
+ * @param ottToken - The one-time token for widget authentication.
458
+ * @param quote - The buy quote to pre-fill in the widget.
459
+ * @param walletAddress - The destination wallet address.
460
+ * @param extraParams - Optional additional URL parameters.
461
+ * @returns The fully constructed widget URL string.
462
+ */
463
+ export type RampsControllerTransakGeneratePaymentWidgetUrlAction = {
464
+ type: `RampsController:transakGeneratePaymentWidgetUrl`;
465
+ handler: RampsController['transakGeneratePaymentWidgetUrl'];
466
+ };
467
+ /**
468
+ * Submits the user's purpose of usage form for KYC compliance.
469
+ *
470
+ * @param purpose - Array of purpose strings selected by the user.
471
+ * @returns A promise that resolves when the form is submitted.
472
+ */
473
+ export type RampsControllerTransakSubmitPurposeOfUsageFormAction = {
474
+ type: `RampsController:transakSubmitPurposeOfUsageForm`;
475
+ handler: RampsController['transakSubmitPurposeOfUsageForm'];
476
+ };
477
+ /**
478
+ * Updates the user's personal or address details on Transak.
479
+ *
480
+ * @param data - The user data fields to update.
481
+ * @returns The API response data.
482
+ */
483
+ export type RampsControllerTransakPatchUserAction = {
484
+ type: `RampsController:transakPatchUser`;
485
+ handler: RampsController['transakPatchUser'];
486
+ };
487
+ /**
488
+ * Submits the user's SSN for identity verification.
489
+ *
490
+ * @param ssn - The Social Security Number.
491
+ * @param quoteId - The quote ID associated with the order requiring SSN.
492
+ * @returns The API response data.
493
+ */
494
+ export type RampsControllerTransakSubmitSsnDetailsAction = {
495
+ type: `RampsController:transakSubmitSsnDetails`;
496
+ handler: RampsController['transakSubmitSsnDetails'];
497
+ };
498
+ /**
499
+ * Confirms payment for an order after the user has completed payment.
500
+ *
501
+ * @param orderId - The order ID to confirm payment for.
502
+ * @param paymentMethodId - The payment method used.
503
+ * @returns Whether the payment confirmation was successful.
504
+ */
505
+ export type RampsControllerTransakConfirmPaymentAction = {
506
+ type: `RampsController:transakConfirmPayment`;
507
+ handler: RampsController['transakConfirmPayment'];
508
+ };
509
+ /**
510
+ * Translates generic ramps identifiers to Transak-specific identifiers.
511
+ *
512
+ * @param request - The translation request with optional identifiers to translate.
513
+ * @returns The translated Transak-specific identifiers.
514
+ */
515
+ export type RampsControllerTransakGetTranslationAction = {
516
+ type: `RampsController:transakGetTranslation`;
517
+ handler: RampsController['transakGetTranslation'];
518
+ };
519
+ /**
520
+ * Checks the status of an ID proof submission for KYC.
521
+ *
522
+ * @param workFlowRunId - The workflow run ID to check status for.
523
+ * @returns The current ID proof status.
524
+ */
525
+ export type RampsControllerTransakGetIdProofStatusAction = {
526
+ type: `RampsController:transakGetIdProofStatus`;
527
+ handler: RampsController['transakGetIdProofStatus'];
528
+ };
529
+ /**
530
+ * Cancels a specific Transak order.
531
+ *
532
+ * @param depositOrderId - The deposit order ID to cancel.
533
+ * @returns A promise that resolves when the order is cancelled.
534
+ */
535
+ export type RampsControllerTransakCancelOrderAction = {
536
+ type: `RampsController:transakCancelOrder`;
537
+ handler: RampsController['transakCancelOrder'];
538
+ };
539
+ /**
540
+ * Cancels all active Transak orders. Individual cancellation failures
541
+ * are collected and returned rather than thrown.
542
+ *
543
+ * @returns An array of errors from any failed cancellations (empty if all succeeded).
544
+ */
545
+ export type RampsControllerTransakCancelAllActiveOrdersAction = {
546
+ type: `RampsController:transakCancelAllActiveOrders`;
547
+ handler: RampsController['transakCancelAllActiveOrders'];
548
+ };
549
+ /**
550
+ * Fetches all active Transak orders for the authenticated user.
551
+ *
552
+ * @returns The list of active orders.
553
+ */
554
+ export type RampsControllerTransakGetActiveOrdersAction = {
555
+ type: `RampsController:transakGetActiveOrders`;
556
+ handler: RampsController['transakGetActiveOrders'];
557
+ };
558
+ /**
559
+ * Union of all RampsController action types.
560
+ */
561
+ 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;
562
+ //# sourceMappingURL=RampsController-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RampsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA0B;AAEzD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,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,G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