@metamask/ramps-controller 20.3.0 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/CHANGELOG.md +42 -1
  2. package/dist/{NeoBankService-method-action-types.d.mts → NeoBankService-method-action-types.d.ts} +2 -2
  3. package/dist/NeoBankService-method-action-types.d.ts.map +1 -0
  4. package/dist/{NeoBankService-method-action-types.mjs → NeoBankService-method-action-types.js} +1 -1
  5. package/dist/NeoBankService-method-action-types.js.map +1 -0
  6. package/dist/{NeoBankService.d.cts → NeoBankService.d.ts} +8 -8
  7. package/dist/NeoBankService.d.ts.map +1 -0
  8. package/dist/NeoBankService.js +380 -0
  9. package/dist/NeoBankService.js.map +1 -0
  10. package/dist/{RampsController-method-action-types.d.mts → RampsController-method-action-types.d.ts} +18 -3
  11. package/dist/RampsController-method-action-types.d.ts.map +1 -0
  12. package/dist/{TransakService-method-action-types.mjs → RampsController-method-action-types.js} +1 -1
  13. package/dist/RampsController-method-action-types.js.map +1 -0
  14. package/dist/{RampsController.d.mts → RampsController.d.ts} +86 -23
  15. package/dist/RampsController.d.ts.map +1 -0
  16. package/dist/{RampsController.mjs → RampsController.js} +976 -634
  17. package/dist/RampsController.js.map +1 -0
  18. package/dist/{RampsService-method-action-types.d.cts → RampsService-method-action-types.d.ts} +2 -2
  19. package/dist/RampsService-method-action-types.d.ts.map +1 -0
  20. package/dist/{RampsService-method-action-types.mjs → RampsService-method-action-types.js} +1 -1
  21. package/dist/RampsService-method-action-types.js.map +1 -0
  22. package/dist/{RampsService.d.mts → RampsService.d.ts} +11 -5
  23. package/dist/RampsService.d.ts.map +1 -0
  24. package/dist/{RampsService.mjs → RampsService.js} +159 -147
  25. package/dist/RampsService.js.map +1 -0
  26. package/dist/{RequestCache.d.mts → RequestCache.d.ts} +3 -3
  27. package/dist/RequestCache.d.ts.map +1 -0
  28. package/dist/{RequestCache.mjs → RequestCache.js} +1 -1
  29. package/dist/RequestCache.js.map +1 -0
  30. package/dist/{TransakService-method-action-types.d.cts → TransakService-method-action-types.d.ts} +2 -2
  31. package/dist/TransakService-method-action-types.d.ts.map +1 -0
  32. package/dist/{RampsController-method-action-types.mjs → TransakService-method-action-types.js} +1 -1
  33. package/dist/TransakService-method-action-types.js.map +1 -0
  34. package/dist/{TransakService.d.cts → TransakService.d.ts} +6 -6
  35. package/dist/TransakService.d.ts.map +1 -0
  36. package/dist/TransakService.js +746 -0
  37. package/dist/TransakService.js.map +1 -0
  38. package/dist/{autoramp-types.d.cts → autoramp-types.d.ts} +1 -1
  39. package/dist/autoramp-types.d.ts.map +1 -0
  40. package/dist/autoramp-types.js +2 -0
  41. package/dist/autoramp-types.js.map +1 -0
  42. package/dist/{autorampAccount.d.mts → autorampAccount.d.ts} +3 -3
  43. package/dist/autorampAccount.d.ts.map +1 -0
  44. package/dist/{autorampAccount.mjs → autorampAccount.js} +1 -1
  45. package/dist/autorampAccount.js.map +1 -0
  46. package/dist/{client-identity.d.mts → client-identity.d.ts} +1 -1
  47. package/dist/client-identity.d.ts.map +1 -0
  48. package/dist/{client-identity.mjs → client-identity.js} +1 -1
  49. package/dist/client-identity.js.map +1 -0
  50. package/dist/{errorNormalization.d.mts → errorNormalization.d.ts} +1 -1
  51. package/dist/errorNormalization.d.ts.map +1 -0
  52. package/dist/{errorNormalization.mjs → errorNormalization.js} +1 -1
  53. package/dist/errorNormalization.js.map +1 -0
  54. package/dist/{featureFlags.d.mts → featureFlags.d.ts} +2 -2
  55. package/dist/featureFlags.d.ts.map +1 -0
  56. package/dist/{featureFlags.mjs → featureFlags.js} +1 -1
  57. package/dist/featureFlags.js.map +1 -0
  58. package/dist/{index.d.mts → index.d.ts} +37 -35
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +19 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/order-syncing/constants.d.ts +23 -0
  63. package/dist/order-syncing/constants.d.ts.map +1 -0
  64. package/dist/order-syncing/constants.js +23 -0
  65. package/dist/order-syncing/constants.js.map +1 -0
  66. package/dist/order-syncing/controller-integration.d.ts +91 -0
  67. package/dist/order-syncing/controller-integration.d.ts.map +1 -0
  68. package/dist/order-syncing/controller-integration.js +364 -0
  69. package/dist/order-syncing/controller-integration.js.map +1 -0
  70. package/dist/order-syncing/index.d.ts +7 -0
  71. package/dist/order-syncing/index.d.ts.map +1 -0
  72. package/dist/order-syncing/index.js +5 -0
  73. package/dist/order-syncing/index.js.map +1 -0
  74. package/dist/order-syncing/sync-utils.d.ts +9 -0
  75. package/dist/order-syncing/sync-utils.d.ts.map +1 -0
  76. package/dist/order-syncing/sync-utils.js +27 -0
  77. package/dist/order-syncing/sync-utils.js.map +1 -0
  78. package/dist/order-syncing/types.d.ts +66 -0
  79. package/dist/order-syncing/types.d.ts.map +1 -0
  80. package/dist/order-syncing/types.js +2 -0
  81. package/dist/order-syncing/types.js.map +1 -0
  82. package/dist/order-syncing/utils.d.ts +83 -0
  83. package/dist/order-syncing/utils.d.ts.map +1 -0
  84. package/dist/order-syncing/utils.js +144 -0
  85. package/dist/order-syncing/utils.js.map +1 -0
  86. package/dist/{orderStatus.d.mts → orderStatus.d.ts} +2 -2
  87. package/dist/orderStatus.d.ts.map +1 -0
  88. package/dist/{orderStatus.mjs → orderStatus.js} +2 -2
  89. package/dist/orderStatus.js.map +1 -0
  90. package/dist/{ownership-message.d.cts → ownership-message.d.ts} +1 -1
  91. package/dist/ownership-message.d.ts.map +1 -0
  92. package/dist/{ownership-message.mjs → ownership-message.js} +1 -1
  93. package/dist/ownership-message.js.map +1 -0
  94. package/dist/{paymentMethodMerge.d.cts → paymentMethodMerge.d.ts} +2 -2
  95. package/dist/paymentMethodMerge.d.ts.map +1 -0
  96. package/dist/{paymentMethodMerge.mjs → paymentMethodMerge.js} +1 -1
  97. package/dist/paymentMethodMerge.js.map +1 -0
  98. package/dist/{providerAvailability.d.cts → providerAvailability.d.ts} +2 -2
  99. package/dist/providerAvailability.d.ts.map +1 -0
  100. package/dist/{providerAvailability.mjs → providerAvailability.js} +1 -1
  101. package/dist/providerAvailability.js.map +1 -0
  102. package/dist/{quoteClassification.d.cts → quoteClassification.d.ts} +2 -2
  103. package/dist/quoteClassification.d.ts.map +1 -0
  104. package/dist/{quoteClassification.mjs → quoteClassification.js} +1 -1
  105. package/dist/quoteClassification.js.map +1 -0
  106. package/dist/{rampsErrorCodes.d.cts → rampsErrorCodes.d.ts} +2 -2
  107. package/dist/rampsErrorCodes.d.ts.map +1 -0
  108. package/dist/{rampsErrorCodes.mjs → rampsErrorCodes.js} +1 -1
  109. package/dist/rampsErrorCodes.js.map +1 -0
  110. package/dist/{selectors.d.mts → selectors.d.ts} +3 -3
  111. package/dist/selectors.d.ts.map +1 -0
  112. package/dist/{selectors.mjs → selectors.js} +2 -2
  113. package/dist/selectors.js.map +1 -0
  114. package/dist/{transakApiErrorUtils.d.cts → transakApiErrorUtils.d.ts} +1 -1
  115. package/dist/transakApiErrorUtils.d.ts.map +1 -0
  116. package/dist/{transakApiErrorUtils.mjs → transakApiErrorUtils.js} +3 -3
  117. package/dist/transakApiErrorUtils.js.map +1 -0
  118. package/dist/{transakErrorCodes.d.cts → transakErrorCodes.d.ts} +3 -3
  119. package/dist/transakErrorCodes.d.ts.map +1 -0
  120. package/dist/{transakErrorCodes.mjs → transakErrorCodes.js} +1 -1
  121. package/dist/transakErrorCodes.js.map +1 -0
  122. package/dist/{wallet-registration-machine.d.cts → wallet-registration-machine.d.ts} +1 -1
  123. package/dist/wallet-registration-machine.d.ts.map +1 -0
  124. package/dist/{wallet-registration-machine.mjs → wallet-registration-machine.js} +1 -1
  125. package/dist/wallet-registration-machine.js.map +1 -0
  126. package/dist/{wallet-registration-service.d.cts → wallet-registration-service.d.ts} +1 -1
  127. package/dist/wallet-registration-service.d.ts.map +1 -0
  128. package/dist/{wallet-registration-service.mjs → wallet-registration-service.js} +60 -69
  129. package/dist/wallet-registration-service.js.map +1 -0
  130. package/package.json +18 -21
  131. package/dist/NeoBankService-method-action-types.cjs +0 -7
  132. package/dist/NeoBankService-method-action-types.cjs.map +0 -1
  133. package/dist/NeoBankService-method-action-types.d.cts +0 -126
  134. package/dist/NeoBankService-method-action-types.d.cts.map +0 -1
  135. package/dist/NeoBankService-method-action-types.d.mts.map +0 -1
  136. package/dist/NeoBankService-method-action-types.mjs.map +0 -1
  137. package/dist/NeoBankService.cjs +0 -387
  138. package/dist/NeoBankService.cjs.map +0 -1
  139. package/dist/NeoBankService.d.cts.map +0 -1
  140. package/dist/NeoBankService.d.mts +0 -191
  141. package/dist/NeoBankService.d.mts.map +0 -1
  142. package/dist/NeoBankService.mjs +0 -379
  143. package/dist/NeoBankService.mjs.map +0 -1
  144. package/dist/RampsController-method-action-types.cjs +0 -7
  145. package/dist/RampsController-method-action-types.cjs.map +0 -1
  146. package/dist/RampsController-method-action-types.d.cts +0 -758
  147. package/dist/RampsController-method-action-types.d.cts.map +0 -1
  148. package/dist/RampsController-method-action-types.d.mts.map +0 -1
  149. package/dist/RampsController-method-action-types.mjs.map +0 -1
  150. package/dist/RampsController.cjs +0 -2799
  151. package/dist/RampsController.cjs.map +0 -1
  152. package/dist/RampsController.d.cts +0 -968
  153. package/dist/RampsController.d.cts.map +0 -1
  154. package/dist/RampsController.d.mts.map +0 -1
  155. package/dist/RampsController.mjs.map +0 -1
  156. package/dist/RampsService-method-action-types.cjs +0 -7
  157. package/dist/RampsService-method-action-types.cjs.map +0 -1
  158. package/dist/RampsService-method-action-types.d.cts.map +0 -1
  159. package/dist/RampsService-method-action-types.d.mts +0 -171
  160. package/dist/RampsService-method-action-types.d.mts.map +0 -1
  161. package/dist/RampsService-method-action-types.mjs.map +0 -1
  162. package/dist/RampsService.cjs +0 -708
  163. package/dist/RampsService.cjs.map +0 -1
  164. package/dist/RampsService.d.cts +0 -944
  165. package/dist/RampsService.d.cts.map +0 -1
  166. package/dist/RampsService.d.mts.map +0 -1
  167. package/dist/RampsService.mjs.map +0 -1
  168. package/dist/RequestCache.cjs +0 -103
  169. package/dist/RequestCache.cjs.map +0 -1
  170. package/dist/RequestCache.d.cts +0 -110
  171. package/dist/RequestCache.d.cts.map +0 -1
  172. package/dist/RequestCache.d.mts.map +0 -1
  173. package/dist/RequestCache.mjs.map +0 -1
  174. package/dist/TransakService-method-action-types.cjs +0 -7
  175. package/dist/TransakService-method-action-types.cjs.map +0 -1
  176. package/dist/TransakService-method-action-types.d.cts.map +0 -1
  177. package/dist/TransakService-method-action-types.d.mts +0 -140
  178. package/dist/TransakService-method-action-types.d.mts.map +0 -1
  179. package/dist/TransakService-method-action-types.mjs.map +0 -1
  180. package/dist/TransakService.cjs +0 -743
  181. package/dist/TransakService.cjs.map +0 -1
  182. package/dist/TransakService.d.cts.map +0 -1
  183. package/dist/TransakService.d.mts +0 -370
  184. package/dist/TransakService.d.mts.map +0 -1
  185. package/dist/TransakService.mjs +0 -734
  186. package/dist/TransakService.mjs.map +0 -1
  187. package/dist/autoramp-types.cjs +0 -3
  188. package/dist/autoramp-types.cjs.map +0 -1
  189. package/dist/autoramp-types.d.cts.map +0 -1
  190. package/dist/autoramp-types.d.mts +0 -22
  191. package/dist/autoramp-types.d.mts.map +0 -1
  192. package/dist/autoramp-types.mjs +0 -2
  193. package/dist/autoramp-types.mjs.map +0 -1
  194. package/dist/autorampAccount.cjs +0 -155
  195. package/dist/autorampAccount.cjs.map +0 -1
  196. package/dist/autorampAccount.d.cts +0 -126
  197. package/dist/autorampAccount.d.cts.map +0 -1
  198. package/dist/autorampAccount.d.mts.map +0 -1
  199. package/dist/autorampAccount.mjs.map +0 -1
  200. package/dist/client-identity.cjs +0 -28
  201. package/dist/client-identity.cjs.map +0 -1
  202. package/dist/client-identity.d.cts +0 -24
  203. package/dist/client-identity.d.cts.map +0 -1
  204. package/dist/client-identity.d.mts.map +0 -1
  205. package/dist/client-identity.mjs.map +0 -1
  206. package/dist/errorNormalization.cjs +0 -84
  207. package/dist/errorNormalization.cjs.map +0 -1
  208. package/dist/errorNormalization.d.cts +0 -56
  209. package/dist/errorNormalization.d.cts.map +0 -1
  210. package/dist/errorNormalization.d.mts.map +0 -1
  211. package/dist/errorNormalization.mjs.map +0 -1
  212. package/dist/featureFlags.cjs +0 -144
  213. package/dist/featureFlags.cjs.map +0 -1
  214. package/dist/featureFlags.d.cts +0 -82
  215. package/dist/featureFlags.d.cts.map +0 -1
  216. package/dist/featureFlags.d.mts.map +0 -1
  217. package/dist/featureFlags.mjs.map +0 -1
  218. package/dist/index.cjs +0 -82
  219. package/dist/index.cjs.map +0 -1
  220. package/dist/index.d.cts +0 -35
  221. package/dist/index.d.cts.map +0 -1
  222. package/dist/index.d.mts.map +0 -1
  223. package/dist/index.mjs +0 -18
  224. package/dist/index.mjs.map +0 -1
  225. package/dist/orderStatus.cjs +0 -34
  226. package/dist/orderStatus.cjs.map +0 -1
  227. package/dist/orderStatus.d.cts +0 -18
  228. package/dist/orderStatus.d.cts.map +0 -1
  229. package/dist/orderStatus.d.mts.map +0 -1
  230. package/dist/orderStatus.mjs.map +0 -1
  231. package/dist/ownership-message.cjs +0 -26
  232. package/dist/ownership-message.cjs.map +0 -1
  233. package/dist/ownership-message.d.cts.map +0 -1
  234. package/dist/ownership-message.d.mts +0 -22
  235. package/dist/ownership-message.d.mts.map +0 -1
  236. package/dist/ownership-message.mjs.map +0 -1
  237. package/dist/paymentMethodMerge.cjs +0 -51
  238. package/dist/paymentMethodMerge.cjs.map +0 -1
  239. package/dist/paymentMethodMerge.d.cts.map +0 -1
  240. package/dist/paymentMethodMerge.d.mts +0 -26
  241. package/dist/paymentMethodMerge.d.mts.map +0 -1
  242. package/dist/paymentMethodMerge.mjs.map +0 -1
  243. package/dist/providerAvailability.cjs +0 -134
  244. package/dist/providerAvailability.cjs.map +0 -1
  245. package/dist/providerAvailability.d.cts.map +0 -1
  246. package/dist/providerAvailability.d.mts +0 -101
  247. package/dist/providerAvailability.d.mts.map +0 -1
  248. package/dist/providerAvailability.mjs.map +0 -1
  249. package/dist/quoteClassification.cjs +0 -44
  250. package/dist/quoteClassification.cjs.map +0 -1
  251. package/dist/quoteClassification.d.cts.map +0 -1
  252. package/dist/quoteClassification.d.mts +0 -33
  253. package/dist/quoteClassification.d.mts.map +0 -1
  254. package/dist/quoteClassification.mjs.map +0 -1
  255. package/dist/rampsErrorCodes.cjs +0 -11
  256. package/dist/rampsErrorCodes.cjs.map +0 -1
  257. package/dist/rampsErrorCodes.d.cts.map +0 -1
  258. package/dist/rampsErrorCodes.d.mts +0 -9
  259. package/dist/rampsErrorCodes.d.mts.map +0 -1
  260. package/dist/rampsErrorCodes.mjs.map +0 -1
  261. package/dist/selectors.cjs +0 -85
  262. package/dist/selectors.cjs.map +0 -1
  263. package/dist/selectors.d.cts +0 -78
  264. package/dist/selectors.d.cts.map +0 -1
  265. package/dist/selectors.d.mts.map +0 -1
  266. package/dist/selectors.mjs.map +0 -1
  267. package/dist/transakApiErrorUtils.cjs +0 -15
  268. package/dist/transakApiErrorUtils.cjs.map +0 -1
  269. package/dist/transakApiErrorUtils.d.cts.map +0 -1
  270. package/dist/transakApiErrorUtils.d.mts +0 -3
  271. package/dist/transakApiErrorUtils.d.mts.map +0 -1
  272. package/dist/transakApiErrorUtils.mjs.map +0 -1
  273. package/dist/transakErrorCodes.cjs +0 -14
  274. package/dist/transakErrorCodes.cjs.map +0 -1
  275. package/dist/transakErrorCodes.d.cts.map +0 -1
  276. package/dist/transakErrorCodes.d.mts +0 -12
  277. package/dist/transakErrorCodes.d.mts.map +0 -1
  278. package/dist/transakErrorCodes.mjs.map +0 -1
  279. package/dist/wallet-registration-machine.cjs +0 -144
  280. package/dist/wallet-registration-machine.cjs.map +0 -1
  281. package/dist/wallet-registration-machine.d.cts.map +0 -1
  282. package/dist/wallet-registration-machine.d.mts +0 -81
  283. package/dist/wallet-registration-machine.d.mts.map +0 -1
  284. package/dist/wallet-registration-machine.mjs.map +0 -1
  285. package/dist/wallet-registration-service.cjs +0 -351
  286. package/dist/wallet-registration-service.cjs.map +0 -1
  287. package/dist/wallet-registration-service.d.cts.map +0 -1
  288. package/dist/wallet-registration-service.d.mts +0 -144
  289. package/dist/wallet-registration-service.d.mts.map +0 -1
  290. package/dist/wallet-registration-service.mjs.map +0 -1
@@ -1,944 +0,0 @@
1
- import type { CreateServicePolicyOptions, ServicePolicy } from "@metamask/controller-utils";
2
- import type { Messenger } from "@metamask/messenger";
3
- import type { AuthenticationController } from "@metamask/profile-sync-controller";
4
- import type { RampsServiceMethodActions } from "./RampsService-method-action-types.cjs";
5
- /**
6
- * Represents phone number information for a country.
7
- */
8
- export type CountryPhone = {
9
- prefix: string;
10
- placeholder: string;
11
- template: string;
12
- };
13
- /**
14
- * Indicates whether a region supports buy and/or sell actions.
15
- */
16
- export type SupportedActions = {
17
- /**
18
- * Whether buy actions are supported.
19
- */
20
- buy: boolean;
21
- /**
22
- * Whether sell actions are supported.
23
- */
24
- sell: boolean;
25
- };
26
- /**
27
- * Represents a state/province within a country.
28
- */
29
- export type State = {
30
- /**
31
- * State identifier. Can be in path format (e.g., "/regions/us-ut") or ISO code format (e.g., "us-ut").
32
- */
33
- id?: string;
34
- /**
35
- * State name.
36
- */
37
- name?: string;
38
- /**
39
- * ISO state code (e.g., "UT", "NY").
40
- */
41
- stateId?: string;
42
- /**
43
- * Whether this state is supported for buy and/or sell ramp actions.
44
- */
45
- supported?: SupportedActions;
46
- /**
47
- * Whether this state is recommended.
48
- */
49
- recommended?: boolean;
50
- };
51
- /**
52
- * Represents a provider link.
53
- */
54
- export type ProviderLink = {
55
- name: string;
56
- url: string;
57
- };
58
- /**
59
- * Represents provider logos.
60
- */
61
- export type ProviderLogos = {
62
- light: string;
63
- dark: string;
64
- height: number;
65
- width: number;
66
- };
67
- /**
68
- * Browser type for provider buy features.
69
- */
70
- export type ProviderBrowserType = 'APP_BROWSER' | 'IN_APP_OS_BROWSER' | null;
71
- /**
72
- * Fiat amount limits for a provider and payment method.
73
- */
74
- export type ProviderLimit = {
75
- minAmount: number;
76
- maxAmount: number;
77
- feeFixedRate: number;
78
- feeDynamicRate: number;
79
- };
80
- /**
81
- * Fiat buy limits keyed by lowercased fiat short code, then payment method id.
82
- */
83
- export type ProviderFiatLimits = Record<string, Record<string, ProviderLimit>>;
84
- /**
85
- * Provider limits exposed by the regions providers endpoint.
86
- */
87
- export type ProviderLimits = {
88
- fiat?: ProviderFiatLimits;
89
- };
90
- /**
91
- * Represents a ramp provider.
92
- */
93
- export type Provider = {
94
- id: string;
95
- name: string;
96
- /**
97
- * Provider classification from the v2 API: 'native' (first-party
98
- * integration, e.g. Transak Native) or 'aggregator' (third-party redirect).
99
- * May be absent on responses that predate the v2 type field.
100
- */
101
- type?: 'aggregator' | 'native';
102
- environmentType: string;
103
- description: string;
104
- hqAddress: string;
105
- links: ProviderLink[];
106
- logos: ProviderLogos;
107
- supportedCryptoCurrencies?: Record<string, boolean>;
108
- supportedFiatCurrencies?: Record<string, boolean>;
109
- supportedPaymentMethods?: Record<string, boolean>;
110
- limits?: ProviderLimits;
111
- };
112
- /**
113
- * Backend-defined ordering for providers.
114
- */
115
- export type ProviderSortOrder = {
116
- sortBy: string;
117
- ids: string[];
118
- };
119
- /**
120
- * Response from the region providers API.
121
- */
122
- export type ProvidersResponse = {
123
- providers: Provider[];
124
- sorted?: ProviderSortOrder[];
125
- };
126
- /**
127
- * Represents a payment method for funding a purchase.
128
- */
129
- export type PaymentMethod = {
130
- /**
131
- * Canonical payment method ID (e.g., "/payments/debit-credit-card").
132
- */
133
- id: string;
134
- /**
135
- * Payment type identifier (e.g., "debit-credit-card", "bank-transfer").
136
- */
137
- paymentType: string;
138
- /**
139
- * User-facing name for the payment method.
140
- */
141
- name: string;
142
- /**
143
- * Score for sorting payment methods (higher is better).
144
- */
145
- score: number;
146
- /**
147
- * Icon identifier for the payment method.
148
- */
149
- icon: string;
150
- /**
151
- * Localized disclaimer text (optional).
152
- */
153
- disclaimer?: string;
154
- /**
155
- * Delay in minutes (e.g., [5, 10]).
156
- */
157
- delay?: number[];
158
- /**
159
- * Localized pending order description (optional).
160
- */
161
- pendingOrderDescription?: string;
162
- /**
163
- * Whether this payment method is a manual bank transfer.
164
- */
165
- isManualBankTransfer?: boolean;
166
- };
167
- /**
168
- * Response from the paymentMethods API.
169
- */
170
- export type PaymentMethodsResponse = {
171
- /**
172
- * List of available payment methods.
173
- */
174
- payments: PaymentMethod[];
175
- /**
176
- * Recommended sorting for payment methods.
177
- */
178
- sort?: {
179
- ids: string[];
180
- sortBy: string;
181
- };
182
- };
183
- /**
184
- * Sort criteria for quotes.
185
- */
186
- export type QuoteSortBy = 'price' | 'reliability';
187
- /**
188
- * Represents crypto translation info for a quote.
189
- */
190
- export type QuoteCryptoTranslation = {
191
- /**
192
- * The crypto currency ID.
193
- */
194
- id?: string;
195
- /**
196
- * The crypto symbol.
197
- */
198
- symbol?: string;
199
- /**
200
- * The chain ID.
201
- */
202
- chainId?: string;
203
- };
204
- /**
205
- * Widget information for executing a buy order.
206
- */
207
- export type BuyWidget = {
208
- /**
209
- * The widget URL to open for the user to complete the purchase.
210
- */
211
- url: string;
212
- /**
213
- * The browser type to use for opening the widget.
214
- */
215
- browser?: ProviderBrowserType;
216
- /**
217
- * Order ID if already created.
218
- */
219
- orderId?: string | null;
220
- };
221
- /**
222
- * Represents an individual quote from a provider.
223
- */
224
- export type Quote = {
225
- /**
226
- * The provider ID (e.g., "/providers/moonpay").
227
- */
228
- provider: string;
229
- /**
230
- * The quote details.
231
- */
232
- quote: {
233
- /**
234
- * The amount the user is paying (in fiat for buy, crypto for sell).
235
- */
236
- amountIn: number | string;
237
- /**
238
- * The amount the user will receive (in crypto for buy, fiat for sell).
239
- */
240
- amountOut: number | string;
241
- /**
242
- * The payment method used for this quote.
243
- */
244
- paymentMethod: string;
245
- /**
246
- * The fiat value of the output amount (for buy actions).
247
- */
248
- amountOutInFiat?: number;
249
- /**
250
- * Crypto translation info for display.
251
- */
252
- cryptoTranslation?: QuoteCryptoTranslation;
253
- /**
254
- * Total fees in the source currency.
255
- */
256
- totalFees?: number | string;
257
- /**
258
- * Network fees.
259
- */
260
- networkFee?: number | string;
261
- /**
262
- * Provider fees.
263
- */
264
- providerFee?: number | string;
265
- /**
266
- * Buy URL endpoint that returns the actual provider widget URL.
267
- *
268
- * This is a MetaMask-hosted endpoint that, when fetched, returns JSON with the provider's widget URL.
269
- *
270
- * @deprecated Use buyWidget instead - it's embedded in the quote response.
271
- */
272
- buyURL?: string;
273
- /**
274
- * Widget information embedded in the quote response.
275
- * Contains the widget URL, browser type, and optional pre-order tracking ID.
276
- */
277
- buyWidget?: BuyWidget;
278
- };
279
- /**
280
- * Metadata about the quote.
281
- */
282
- metadata?: {
283
- /**
284
- * Reliability score for the provider (0-100).
285
- */
286
- reliability?: number;
287
- /**
288
- * Tags for the quote.
289
- */
290
- tags?: {
291
- /**
292
- * Whether this is the best rate quote.
293
- */
294
- isBestRate?: boolean;
295
- /**
296
- * Whether this is the most reliable provider.
297
- */
298
- isMostReliable?: boolean;
299
- };
300
- };
301
- };
302
- /**
303
- * Represents an error from a provider when fetching quotes.
304
- */
305
- export type QuoteError = {
306
- /**
307
- * The provider ID that failed.
308
- */
309
- provider: string;
310
- /**
311
- * Error message.
312
- */
313
- error?: string;
314
- };
315
- /**
316
- * Sort order information for quotes.
317
- */
318
- export type QuoteSortOrder = {
319
- /**
320
- * The sort criteria.
321
- */
322
- sortBy: QuoteSortBy;
323
- /**
324
- * Provider IDs in sorted order.
325
- */
326
- ids: string[];
327
- };
328
- /**
329
- * Custom action for a provider (e.g., Apple Pay).
330
- */
331
- export type QuoteCustomAction = {
332
- /**
333
- * Buy action details.
334
- */
335
- buy: {
336
- /**
337
- * Provider ID.
338
- */
339
- providerId: string;
340
- };
341
- /**
342
- * Payment method ID this action applies to.
343
- */
344
- paymentMethodId: string;
345
- /**
346
- * Supported payment method IDs.
347
- */
348
- supportedPaymentMethodIds: string[];
349
- };
350
- /**
351
- * Response from the quotes API.
352
- */
353
- export type QuotesResponse = {
354
- /**
355
- * Successfully retrieved quotes.
356
- */
357
- success: Quote[];
358
- /**
359
- * Sort orders for the quotes.
360
- */
361
- sorted: QuoteSortOrder[];
362
- /**
363
- * Errors from providers that failed to return quotes.
364
- */
365
- error: QuoteError[];
366
- /**
367
- * Custom actions available from providers.
368
- */
369
- customActions: QuoteCustomAction[];
370
- };
371
- /**
372
- * Parameters for fetching quotes.
373
- */
374
- export type GetQuotesParams = {
375
- /**
376
- * The region code (e.g., "us", "us-ca").
377
- */
378
- region: string;
379
- /**
380
- * Array of payment method IDs to get quotes for.
381
- */
382
- paymentMethods: string[];
383
- /**
384
- * The CAIP-19 asset ID (e.g., "eip155:1/erc20:0x...").
385
- */
386
- assetId: string;
387
- /**
388
- * The fiat currency code (e.g., "usd").
389
- */
390
- fiat: string;
391
- /**
392
- * The amount (in fiat for buy, crypto for sell).
393
- */
394
- amount: number;
395
- /**
396
- * The destination wallet address.
397
- */
398
- walletAddress: string;
399
- /**
400
- * Optional redirect URL after order completion.
401
- */
402
- redirectUrl?: string;
403
- /**
404
- * Optional provider IDs to filter quotes.
405
- */
406
- providers?: string[];
407
- /**
408
- * The ramp action type. Defaults to 'buy'.
409
- */
410
- action?: RampAction;
411
- };
412
- /**
413
- * Represents a country returned from the regions/countries API.
414
- */
415
- export type Country = {
416
- /**
417
- * ISO-2 country code (e.g., "US", "GB").
418
- */
419
- isoCode: string;
420
- /**
421
- * Country identifier. Can be in path format (e.g., "/regions/us") or ISO code format.
422
- * If not provided, defaults to isoCode.
423
- */
424
- id?: string;
425
- /**
426
- * Country flag emoji or code.
427
- */
428
- flag: string;
429
- /**
430
- * Country name.
431
- */
432
- name: string;
433
- /**
434
- * Phone number information.
435
- */
436
- phone: CountryPhone;
437
- /**
438
- * Default currency code.
439
- */
440
- currency: string;
441
- /**
442
- * Whether this country is supported for buy and/or sell ramp actions.
443
- */
444
- supported: SupportedActions;
445
- /**
446
- * Whether this country is recommended.
447
- */
448
- recommended?: boolean;
449
- /**
450
- * Array of state objects.
451
- */
452
- states?: State[];
453
- /**
454
- * Default amount for ramps transactions.
455
- */
456
- defaultAmount?: number;
457
- /**
458
- * Quick amount options for ramps transactions.
459
- */
460
- quickAmounts?: number[];
461
- };
462
- /**
463
- * Represents a token returned from the regions/{region}/tokens API.
464
- */
465
- export type RampsToken = {
466
- /**
467
- * The asset identifier in CAIP-19 format (e.g., "eip155:1/erc20:0x...").
468
- */
469
- assetId: string;
470
- /**
471
- * The chain identifier in CAIP-2 format (e.g., "eip155:1").
472
- */
473
- chainId: string;
474
- /**
475
- * Token name (e.g., "USD Coin").
476
- */
477
- name: string;
478
- /**
479
- * Token symbol (e.g., "USDC").
480
- */
481
- symbol: string;
482
- /**
483
- * Number of decimals for the token.
484
- */
485
- decimals: number;
486
- /**
487
- * URL to the token icon.
488
- */
489
- iconUrl: string;
490
- /**
491
- * Whether this token is supported.
492
- */
493
- tokenSupported: boolean;
494
- };
495
- /**
496
- * Response from the regions/{region}/tokens API.
497
- */
498
- export type TokensResponse = {
499
- /**
500
- * Top/popular tokens for the region.
501
- */
502
- topTokens: RampsToken[];
503
- /**
504
- * All available tokens for the region.
505
- */
506
- allTokens: RampsToken[];
507
- };
508
- /**
509
- * Possible statuses for a ramps order.
510
- */
511
- export declare enum RampsOrderStatus {
512
- Unknown = "UNKNOWN",
513
- Precreated = "PRECREATED",
514
- Created = "CREATED",
515
- Pending = "PENDING",
516
- Failed = "FAILED",
517
- Completed = "COMPLETED",
518
- Cancelled = "CANCELLED",
519
- IdExpired = "ID_EXPIRED"
520
- }
521
- /**
522
- * Network information associated with an order.
523
- */
524
- export type RampsOrderNetwork = {
525
- name: string;
526
- chainId: string;
527
- };
528
- /**
529
- * Crypto currency information associated with an order.
530
- */
531
- export type RampsOrderCryptoCurrency = {
532
- assetId?: string;
533
- name?: string;
534
- chainId?: string;
535
- decimals?: number;
536
- iconUrl?: string;
537
- symbol: string;
538
- };
539
- /**
540
- * Payment method information associated with an order.
541
- */
542
- export type RampsOrderPaymentMethod = {
543
- id: string;
544
- name?: string;
545
- shortName?: string;
546
- duration?: string;
547
- icon?: string;
548
- isManualBankTransfer?: boolean;
549
- };
550
- /**
551
- * Bank transfer instruction fields attached to an order by providers
552
- * that require manual payment (e.g. SEPA, wire transfer).
553
- */
554
- export type OrderPaymentDetail = {
555
- fiatCurrency: string;
556
- paymentMethod: string;
557
- fields: {
558
- name: string;
559
- id: string;
560
- value: string;
561
- }[];
562
- };
563
- /**
564
- * Fiat currency information associated with an order.
565
- */
566
- export type RampsOrderFiatCurrency = {
567
- id?: string;
568
- symbol: string;
569
- name?: string;
570
- decimals?: number;
571
- denomSymbol?: string;
572
- };
573
- /**
574
- * A unified order type returned from the V2 API.
575
- * The V2 endpoint normalizes all provider responses into this shape.
576
- */
577
- export type RampsOrder = {
578
- id?: string;
579
- isOnlyLink: boolean;
580
- provider?: Provider;
581
- success: boolean;
582
- cryptoAmount: string | number;
583
- fiatAmount: number;
584
- cryptoCurrency?: RampsOrderCryptoCurrency;
585
- fiatCurrency?: RampsOrderFiatCurrency;
586
- providerOrderId: string;
587
- providerOrderLink: string;
588
- createdAt: number;
589
- paymentMethod?: RampsOrderPaymentMethod;
590
- totalFeesFiat: number;
591
- txHash: string;
592
- walletAddress: string;
593
- status: RampsOrderStatus;
594
- network: RampsOrderNetwork;
595
- canBeUpdated: boolean;
596
- idHasExpired: boolean;
597
- idExpirationDate?: number;
598
- excludeFromPurchases: boolean;
599
- timeDescriptionPending: string;
600
- fiatAmountInUsd?: number;
601
- feesInUsd?: number;
602
- region?: string;
603
- orderType: string;
604
- exchangeRate?: number;
605
- pollingSecondsMinimum?: number;
606
- statusDescription?: string;
607
- partnerFees?: number;
608
- networkFees?: number;
609
- paymentDetails?: OrderPaymentDetail[];
610
- };
611
- /**
612
- * The SDK version to send with API requests. (backwards-compatibility)
613
- */
614
- export declare const RAMPS_SDK_VERSION = "2.1.6";
615
- /**
616
- * The type of ramp action: 'buy' or 'sell'.
617
- */
618
- export type RampAction = 'buy' | 'sell';
619
- /**
620
- * The name of the {@link RampsService}, used to namespace the
621
- * service's actions and events.
622
- */
623
- export declare const serviceName = "RampsService";
624
- /**
625
- * The environment to use for API requests.
626
- */
627
- export declare enum RampsEnvironment {
628
- Production = "production",
629
- Staging = "staging",
630
- Development = "development",
631
- Local = "local"
632
- }
633
- /**
634
- * The type of ramps API service.
635
- * Determines which base URL to use (cache vs standard).
636
- */
637
- export declare enum RampsApiService {
638
- Regions = "regions",
639
- Orders = "orders"
640
- }
641
- /**
642
- * Actions that {@link RampsService} exposes to other consumers.
643
- */
644
- export type RampsServiceActions = RampsServiceMethodActions;
645
- /**
646
- * Actions from other messengers that {@link RampsService} calls.
647
- */
648
- type AllowedActions = AuthenticationController.AuthenticationControllerGetBearerTokenAction;
649
- /**
650
- * Events that {@link RampsService} exposes to other consumers.
651
- */
652
- export type RampsServiceEvents = never;
653
- /**
654
- * Events from other messengers that {@link RampsService} subscribes to.
655
- */
656
- type AllowedEvents = never;
657
- /**
658
- * The messenger which is restricted to actions and events accessed by
659
- * {@link RampsService}.
660
- */
661
- export type RampsServiceMessenger = Messenger<typeof serviceName, RampsServiceActions | AllowedActions, RampsServiceEvents | AllowedEvents>;
662
- /**
663
- * Derives the default redirect ("fake callback") URL for the widened Headless
664
- * Buy quote fetch from the ramps environment.
665
- *
666
- * The quotes API only embeds a `buyURL`/`buyWidget` (the WebView page a
667
- * non-native provider needs) when a `redirectUrl` is present, so the widened
668
- * aggregator path supplies this default when the caller omits one. Production
669
- * and staging serve the callback from the `on-ramp-content` CDN hosts;
670
- * development has no `on-ramp-content.dev-api` deployment, so it uses the
671
- * `on-ramp.dev-api` host (which serves `/regions/fake-callback` and returns
672
- * 200). This intentionally does not reuse {@link getBaseUrl}, whose Regions
673
- * host is `on-ramp{-cache}`, not `on-ramp-content`.
674
- *
675
- * This is the canonical environment-to-callback map for the whole package.
676
- * Prefer the `RampsService:getDefaultRedirectCallbackUrl` messenger action at
677
- * runtime so the value always follows the environment the service is actually
678
- * configured with. Call this function directly only where a synchronous,
679
- * messenger-free value is needed (for example client UI that matches the
680
- * callback URL in a WebView), and pass the same environment the service was
681
- * constructed with.
682
- *
683
- * @param environment - The environment to derive the callback URL for.
684
- * @returns The default redirect callback URL for that environment.
685
- */
686
- export declare function getDefaultRedirectCallbackUrl(environment: RampsEnvironment): string;
687
- /**
688
- * This service object is responsible for interacting with the Ramps API.
689
- *
690
- * @example
691
- *
692
- * ``` ts
693
- * import { Messenger } from '@metamask/messenger';
694
- * import type {
695
- * RampsServiceActions,
696
- * RampsServiceEvents,
697
- * } from '@metamask/ramps-controller';
698
- *
699
- * const rootMessenger = new Messenger<
700
- * 'Root',
701
- * RampsServiceActions
702
- * RampsServiceEvents
703
- * >({ namespace: 'Root' });
704
- * const rampsServiceMessenger = new Messenger<
705
- * 'RampsService',
706
- * RampsServiceActions,
707
- * RampsServiceEvents,
708
- * typeof rootMessenger,
709
- * >({
710
- * namespace: 'RampsService',
711
- * parent: rootMessenger,
712
- * });
713
- * // Instantiate the service to register its actions on the messenger
714
- * new RampsService({
715
- * messenger: rampsServiceMessenger,
716
- * environment: RampsEnvironment.Production,
717
- * context: 'mobile-ios',
718
- * fetch,
719
- * });
720
- *
721
- * // Later...
722
- * // Get the user's geolocation
723
- * const geolocation = await rootMessenger.call(
724
- * 'RampsService:getGeolocation',
725
- * );
726
- * // ... Do something with the geolocation ...
727
- * ```
728
- */
729
- export declare class RampsService {
730
- #private;
731
- /**
732
- * The name of the service.
733
- */
734
- readonly name: typeof serviceName;
735
- /**
736
- * Constructs a new RampsService object.
737
- *
738
- * @param args - The constructor arguments.
739
- * @param args.messenger - The messenger suited for this service.
740
- * @param args.environment - The environment to use for API requests.
741
- * @param args.context - The context for API requests (e.g., 'mobile-ios', 'mobile-android').
742
- * @param args.fetch - A function that can be used to make an HTTP request. If
743
- * your JavaScript environment supports `fetch` natively, you'll probably want
744
- * to pass that; otherwise you can pass an equivalent (such as `fetch` via
745
- * `node-fetch`).
746
- * @param args.policyOptions - Options to pass to `createServicePolicy`, which
747
- * is used to wrap each request. See {@link CreateServicePolicyOptions}.
748
- * @param args.baseUrlOverride - Optional base URL override for local development.
749
- * @param args.clientProduct - Optional MetaMask product id (`metamask-mobile`).
750
- * @param args.clientVersion - Optional app SemVer (not the ramps-controller package version).
751
- */
752
- constructor({ messenger, environment, context, fetch: fetchFunction, policyOptions, baseUrlOverride, clientProduct, clientVersion, }: {
753
- messenger: RampsServiceMessenger;
754
- environment?: RampsEnvironment;
755
- context: string;
756
- fetch: typeof fetch;
757
- policyOptions?: CreateServicePolicyOptions;
758
- baseUrlOverride?: string;
759
- clientProduct?: string;
760
- clientVersion?: string;
761
- });
762
- /**
763
- * Returns the default redirect ("fake callback") URL for this service's
764
- * environment.
765
- *
766
- * The quotes API only embeds a `buyURL`/`buyWidget` (the WebView page a
767
- * non-native provider needs) when a `redirectUrl` is present, so callers
768
- * that omit one (MM Pay's widened Headless Buy fetch) use this value.
769
- * Exposing it here makes the service's environment the single runtime source
770
- * of truth, so the callback can never point at a different environment than
771
- * the one the quotes themselves came from.
772
- *
773
- * `baseUrlOverride` deliberately does not apply. That option overrides the
774
- * ramps API base URL for local development. In production and staging the
775
- * callback lives on a different host (`on-ramp-content` versus
776
- * `on-ramp{-cache}`), so an API override says nothing about where
777
- * `/regions/fake-callback` lives. In development the callback already shares
778
- * the API host family (`on-ramp.dev-api`). The redirect URL is also handed
779
- * to the provider and matched by client UI to detect flow completion, so
780
- * returning an unrelated local API origin here would break completion
781
- * detection rather than help it. Point `environment` at
782
- * {@link RampsEnvironment.Local} for a localhost callback, noting that URL
783
- * is pinned to `http://localhost:3000` and does not follow a non-3000
784
- * `baseUrlOverride`.
785
- *
786
- * @returns The default redirect callback URL for the configured environment.
787
- */
788
- getDefaultRedirectCallbackUrl(): string;
789
- /**
790
- * Registers a handler that will be called after a request returns a non-500
791
- * response, causing a retry. Primarily useful in tests where timers are being
792
- * mocked.
793
- *
794
- * @param listener - The handler to be called.
795
- * @returns An object that can be used to unregister the handler. See
796
- * {@link CockatielEvent}.
797
- * @see {@link createServicePolicy}
798
- */
799
- onRetry(listener: Parameters<ServicePolicy['onRetry']>[0]): ReturnType<ServicePolicy['onRetry']>;
800
- /**
801
- * Registers a handler that will be called after a set number of retry rounds
802
- * prove that requests to the API endpoint consistently return a 5xx response.
803
- *
804
- * @param listener - The handler to be called.
805
- * @returns An object that can be used to unregister the handler. See
806
- * {@link CockatielEvent}.
807
- * @see {@link createServicePolicy}
808
- */
809
- onBreak(listener: Parameters<ServicePolicy['onBreak']>[0]): ReturnType<ServicePolicy['onBreak']>;
810
- /**
811
- * Registers a handler that will be called under one of two circumstances:
812
- *
813
- * 1. After a set number of retries prove that requests to the API
814
- * consistently result in one of the following failures:
815
- * 1. A connection initiation error
816
- * 2. A connection reset error
817
- * 3. A timeout error
818
- * 4. A non-JSON response
819
- * 5. A 502, 503, or 504 response
820
- * 2. After a successful request is made to the API, but the response takes
821
- * longer than a set duration to return.
822
- *
823
- * @param listener - The handler to be called.
824
- * @returns An object that can be used to unregister the handler. See
825
- * {@link CockatielEvent}.
826
- */
827
- onDegraded(listener: Parameters<ServicePolicy['onDegraded']>[0]): ReturnType<ServicePolicy['onDegraded']>;
828
- /**
829
- * Makes a request to the API in order to retrieve the user's geolocation
830
- * based on their IP address.
831
- *
832
- * @returns The user's country/region code (e.g., "US-UT" for Utah, USA).
833
- */
834
- getGeolocation(): Promise<string>;
835
- /**
836
- * Makes a request to the cached API to retrieve the list of supported countries.
837
- * The API returns countries with support information for both buy and sell actions.
838
- * Filters countries based on aggregator support (preserves OnRampSDK logic).
839
- *
840
- * @returns An array of countries filtered by aggregator support.
841
- */
842
- getCountries(): Promise<Country[]>;
843
- /**
844
- * Fetches the list of available tokens for a given region and action.
845
- * Supports optional provider filter.
846
- *
847
- * @param region - The region code (e.g., "us", "fr", "us-ny").
848
- * @param action - The ramp action type ('buy' or 'sell').
849
- * @param options - Optional query parameters for filtering tokens.
850
- * @param options.provider - Provider ID(s) to filter by.
851
- * @returns The tokens response containing topTokens and allTokens.
852
- */
853
- getTokens(region: string, action?: RampAction, options?: {
854
- provider?: string | string[];
855
- }): Promise<TokensResponse>;
856
- /**
857
- * Fetches the list of providers for a given region.
858
- * Supports optional query filters: provider, crypto, payments.
859
- * Region local fiat filtering is applied server-side when `fiat` is omitted.
860
- *
861
- * @param regionCode - The region code (e.g., "us", "fr", "us-ny").
862
- * @param options - Optional query parameters for filtering providers.
863
- * @param options.provider - Provider ID(s) to filter by.
864
- * @param options.crypto - Crypto currency ID(s) to filter by.
865
- * @param options.payments - Payment method ID(s) to filter by.
866
- * @returns The providers response containing providers array.
867
- */
868
- getProviders(regionCode: string, options?: {
869
- provider?: string | string[];
870
- crypto?: string | string[];
871
- payments?: string | string[];
872
- }): Promise<ProvidersResponse>;
873
- /**
874
- * Fetches the list of payment methods for a given region, asset, and provider.
875
- *
876
- * Region local fiat filtering is applied server-side when `fiat` is omitted.
877
- *
878
- * @param options - Query parameters for filtering payment methods.
879
- * @param options.region - User's region code (e.g., "us-al").
880
- * @param options.assetId - CAIP-19 cryptocurrency identifier.
881
- * @param options.provider - Provider ID path.
882
- * @returns The payment methods response containing payments array.
883
- */
884
- getPaymentMethods(options: {
885
- region: string;
886
- assetId: string;
887
- provider: string;
888
- }): Promise<PaymentMethodsResponse>;
889
- /**
890
- * Fetches quotes from all providers for a given set of parameters.
891
- * Uses the V2 orders API to get quotes for multiple payment methods at once.
892
- *
893
- * @param params - The parameters for fetching quotes.
894
- * @param params.region - User's region code (e.g., "us", "us-ca").
895
- * @param params.paymentMethods - Array of payment method IDs.
896
- * @param params.assetId - CAIP-19 cryptocurrency identifier.
897
- * @param params.fiat - Fiat currency code (e.g., "usd").
898
- * @param params.amount - The amount (in fiat for buy, crypto for sell).
899
- * @param params.walletAddress - The destination wallet address.
900
- * @param params.redirectUrl - Optional redirect URL after order completion.
901
- * @param params.providers - Optional provider IDs to filter quotes.
902
- * @param params.action - The ramp action type. Defaults to 'buy'.
903
- * @returns The quotes response containing success, sorted, error, and customActions.
904
- */
905
- getQuotes(params: GetQuotesParams): Promise<QuotesResponse>;
906
- /**
907
- * Fetches the buy widget data from a buy URL endpoint.
908
- * Makes a request to the buyURL (as provided in a quote) to get the actual
909
- * provider widget URL, browser type, and order ID.
910
- *
911
- * @param buyUrl - The full buy URL endpoint to fetch from.
912
- * @returns The buy widget data containing the provider widget URL.
913
- */
914
- getBuyWidgetUrl(buyUrl: string): Promise<BuyWidget>;
915
- /**
916
- * Fetches an order from the unified V2 API endpoint.
917
- * This endpoint returns a normalized `RampsOrder` (DepositOrder shape)
918
- * for all provider types, including both aggregator and native providers.
919
- *
920
- * @param providerCode - The provider code (e.g., "transak", "transak-native", "moonpay"),
921
- * with or without the `/providers/` prefix.
922
- * @param orderCode - The order identifier.
923
- * @param wallet - The wallet address associated with the order.
924
- * @returns The unified order data.
925
- */
926
- getOrder(providerCode: string, orderCode: string, wallet: string): Promise<RampsOrder>;
927
- /**
928
- * Extracts an order from a provider callback URL.
929
- * Sends the callback URL to the V2 API backend, which knows how to parse
930
- * each provider's callback format and extract the order ID. Then fetches
931
- * the full order using that ID.
932
- *
933
- * This is the V2 equivalent of the aggregator SDK's `getOrderFromCallback`.
934
- *
935
- * @param providerCode - The provider code (e.g., "transak", "moonpay"),
936
- * with or without the `/providers/` prefix.
937
- * @param callbackUrl - The full callback URL the provider redirected to.
938
- * @param wallet - The wallet address associated with the order.
939
- * @returns The unified order data.
940
- */
941
- getOrderFromCallback(providerCode: string, callbackUrl: string, wallet: string): Promise<RampsOrder>;
942
- }
943
- export {};
944
- //# sourceMappingURL=RampsService.d.cts.map