@metamask/ramps-controller 8.1.0 → 9.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 +13 -1
- package/dist/RampsController.cjs +28 -0
- package/dist/RampsController.cjs.map +1 -1
- package/dist/RampsController.d.cts +25 -3
- package/dist/RampsController.d.cts.map +1 -1
- package/dist/RampsController.d.mts +25 -3
- package/dist/RampsController.d.mts.map +1 -1
- package/dist/RampsController.mjs +28 -0
- package/dist/RampsController.mjs.map +1 -1
- package/dist/RampsService-method-action-types.cjs.map +1 -1
- package/dist/RampsService-method-action-types.d.cts +32 -1
- package/dist/RampsService-method-action-types.d.cts.map +1 -1
- package/dist/RampsService-method-action-types.d.mts +32 -1
- package/dist/RampsService-method-action-types.d.mts.map +1 -1
- package/dist/RampsService-method-action-types.mjs.map +1 -1
- package/dist/RampsService.cjs +83 -1
- package/dist/RampsService.cjs.map +1 -1
- package/dist/RampsService.d.cts +122 -0
- package/dist/RampsService.d.cts.map +1 -1
- package/dist/RampsService.d.mts +122 -0
- package/dist/RampsService.d.mts.map +1 -1
- package/dist/RampsService.mjs +82 -0
- package/dist/RampsService.mjs.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [9.0.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `getOrder` and `getOrderFromCallback` methods to `RampsService` and `RampsController` for V2 unified order polling, along with new `RampsOrder`, `RampsOrderFiatCurrency`, `RampsOrderCryptoCurrency`, `RampsOrderPaymentMethod`, and `RampsOrderStatus` types ([#7934](https://github.com/MetaMask/core/pull/7934))
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **BREAKING:** Use concrete types in `RampsOrder` instead of `string | Object` unions for `provider`, `cryptoCurrency`, `fiatCurrency`, `paymentMethod`, and `network` fields ([#8000](https://github.com/MetaMask/core/pull/8000))
|
|
19
|
+
- Bump `@metamask/controller-utils` from `^11.18.0` to `^11.19.0` ([#7995](https://github.com/MetaMask/core/pull/7995))
|
|
20
|
+
|
|
10
21
|
## [8.1.0]
|
|
11
22
|
|
|
12
23
|
### Added
|
|
@@ -153,7 +164,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
153
164
|
- Add `OnRampService` for interacting with the OnRamp API
|
|
154
165
|
- Add geolocation detection via IP address lookup
|
|
155
166
|
|
|
156
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@
|
|
167
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@9.0.0...HEAD
|
|
168
|
+
[9.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@8.1.0...@metamask/ramps-controller@9.0.0
|
|
157
169
|
[8.1.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@8.0.0...@metamask/ramps-controller@8.1.0
|
|
158
170
|
[8.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@7.1.0...@metamask/ramps-controller@8.0.0
|
|
159
171
|
[7.1.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@7.0.0...@metamask/ramps-controller@7.1.0
|
package/dist/RampsController.cjs
CHANGED
|
@@ -35,6 +35,8 @@ exports.RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS = [
|
|
|
35
35
|
'RampsService:getPaymentMethods',
|
|
36
36
|
'RampsService:getQuotes',
|
|
37
37
|
'RampsService:getBuyWidgetUrl',
|
|
38
|
+
'RampsService:getOrder',
|
|
39
|
+
'RampsService:getOrderFromCallback',
|
|
38
40
|
'TransakService:setApiKey',
|
|
39
41
|
'TransakService:setAccessToken',
|
|
40
42
|
'TransakService:clearAccessToken',
|
|
@@ -1031,6 +1033,32 @@ class RampsController extends base_controller_1.BaseController {
|
|
|
1031
1033
|
return null;
|
|
1032
1034
|
}
|
|
1033
1035
|
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Fetches an order from the unified V2 API endpoint.
|
|
1038
|
+
* Returns a normalized RampsOrder for all provider types (aggregator and native).
|
|
1039
|
+
*
|
|
1040
|
+
* @param providerCode - The provider code (e.g., "transak", "transak-native", "moonpay").
|
|
1041
|
+
* @param orderCode - The order identifier.
|
|
1042
|
+
* @param wallet - The wallet address associated with the order.
|
|
1043
|
+
* @returns The unified order data.
|
|
1044
|
+
*/
|
|
1045
|
+
async getOrder(providerCode, orderCode, wallet) {
|
|
1046
|
+
return await this.messenger.call('RampsService:getOrder', providerCode, orderCode, wallet);
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Extracts an order from a provider callback URL.
|
|
1050
|
+
* Sends the callback URL to the V2 backend for provider-specific parsing,
|
|
1051
|
+
* then fetches the full order. This is the V2 equivalent of the aggregator
|
|
1052
|
+
* SDK's `getOrderFromCallback`.
|
|
1053
|
+
*
|
|
1054
|
+
* @param providerCode - The provider code (e.g., "transak", "moonpay").
|
|
1055
|
+
* @param callbackUrl - The full callback URL the provider redirected to.
|
|
1056
|
+
* @param wallet - The wallet address associated with the order.
|
|
1057
|
+
* @returns The unified order data.
|
|
1058
|
+
*/
|
|
1059
|
+
async getOrderFromCallback(providerCode, callbackUrl, wallet) {
|
|
1060
|
+
return await this.messenger.call('RampsService:getOrderFromCallback', providerCode, callbackUrl, wallet);
|
|
1061
|
+
}
|
|
1034
1062
|
/**
|
|
1035
1063
|
* Sets the Transak API key used for all Transak API requests.
|
|
1036
1064
|
*
|