@metamask/ramps-controller 20.2.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 +30 -1
- package/dist/NeoBankService-method-action-types.d.ts +126 -0
- package/dist/NeoBankService-method-action-types.d.ts.map +1 -0
- package/dist/{TransakService-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.ts +191 -0
- 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} +93 -3
- package/dist/RampsController-method-action-types.d.ts.map +1 -0
- package/dist/{RampsController-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} +164 -17
- package/dist/RampsController.d.ts.map +1 -0
- package/dist/{RampsController.mjs → RampsController.js} +1064 -582
- 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.cts → 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/TransakService-method-action-types.js +6 -0
- package/dist/TransakService-method-action-types.js.map +1 -0
- package/dist/{TransakService.d.mts → 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.ts +22 -0
- 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.ts +126 -0
- package/dist/autorampAccount.d.ts.map +1 -0
- package/dist/autorampAccount.js +147 -0
- package/dist/autorampAccount.js.map +1 -0
- package/dist/{client-identity.d.cts → 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.ts +35 -0
- 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.ts +22 -0
- package/dist/ownership-message.d.ts.map +1 -0
- package/dist/ownership-message.js +22 -0
- 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.mts → 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.ts +81 -0
- package/dist/wallet-registration-machine.d.ts.map +1 -0
- package/dist/wallet-registration-machine.js +139 -0
- package/dist/wallet-registration-machine.js.map +1 -0
- package/dist/wallet-registration-service.d.ts +144 -0
- package/dist/wallet-registration-service.d.ts.map +1 -0
- package/dist/wallet-registration-service.js +335 -0
- package/dist/wallet-registration-service.js.map +1 -0
- package/package.json +17 -21
- 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 -668
- 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 -2429
- package/dist/RampsController.cjs.map +0 -1
- package/dist/RampsController.d.cts.map +0 -1
- package/dist/RampsController.d.mts +0 -821
- 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.map +0 -1
- package/dist/RequestCache.d.mts +0 -110
- 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 +0 -370
- package/dist/TransakService.d.cts.map +0 -1
- package/dist/TransakService.d.mts.map +0 -1
- package/dist/TransakService.mjs +0 -734
- package/dist/TransakService.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.map +0 -1
- package/dist/client-identity.d.mts +0 -24
- 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 -63
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -26
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -26
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -14
- 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/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 +0 -101
- package/dist/providerAvailability.d.cts.map +0 -1
- 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
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { createServicePolicy, handleWhen, HttpError, } from '@metamask/controller-utils';
|
|
2
|
+
import packageJson from '../package.json';
|
|
3
|
+
import { RAMPS_SDK_VERSION, RampsEnvironment } from './RampsService.js';
|
|
4
|
+
import { WalletRegistrationService } from './wallet-registration-service.js';
|
|
5
|
+
/**
|
|
6
|
+
* Name of the NeoBankService messenger namespace.
|
|
7
|
+
*/
|
|
8
|
+
export const serviceName = 'NeoBankService';
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether a failed neo-bank request is worth re-issuing.
|
|
11
|
+
*
|
|
12
|
+
* 4xx responses describe the request or the account's state (e.g. 403
|
|
13
|
+
* "Customer is not active", 422 validation), so repeating them only multiplies
|
|
14
|
+
* the same rejection. 429 stays retryable alongside 5xx and non-HTTP
|
|
15
|
+
* network/timeout errors.
|
|
16
|
+
*
|
|
17
|
+
* @param error - Error thrown while performing the request.
|
|
18
|
+
* @returns `true` when the error is worth retrying.
|
|
19
|
+
*/
|
|
20
|
+
function isRetryableError(error) {
|
|
21
|
+
if (error instanceof HttpError) {
|
|
22
|
+
if (error.httpStatus === 429) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return error.httpStatus < 400 || error.httpStatus >= 500;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
const MESSENGER_EXPOSED_METHODS = [
|
|
30
|
+
'getAutoramp',
|
|
31
|
+
'registerPixAddress',
|
|
32
|
+
'getAutorampQuote',
|
|
33
|
+
'createAutoramp',
|
|
34
|
+
'getAutorampQuoteForAutoramp',
|
|
35
|
+
'attachAutorampQuote',
|
|
36
|
+
'getCustomerByExternalId',
|
|
37
|
+
'getMoonpayCustomerId',
|
|
38
|
+
'getWalletRegistrationStatus',
|
|
39
|
+
'registerSelfHostedWallet',
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Builds a path under the neobank-proxy global prefix.
|
|
43
|
+
*
|
|
44
|
+
* Live neobank-proxy (#1124) mounts routes at `/neobank` on the on-ramp.api
|
|
45
|
+
* host (ALB path routing, no rewrite). Prefer this over `/api/v2/...` so Core
|
|
46
|
+
* matches the proxy that ships.
|
|
47
|
+
*
|
|
48
|
+
* @param path - Path under `/neobank` (no leading slash).
|
|
49
|
+
* @returns Absolute path segment for URL join against the Ramp API host.
|
|
50
|
+
*/
|
|
51
|
+
function getNeoBankPath(path) {
|
|
52
|
+
return `neobank/${path.replace(/^\//u, '')}`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolves the Ramp API host for neo-bank calls (same hosts as {@link RampsService}).
|
|
56
|
+
*
|
|
57
|
+
* @param environment - Ramp environment.
|
|
58
|
+
* @returns Base URL.
|
|
59
|
+
*/
|
|
60
|
+
function getBaseUrl(environment) {
|
|
61
|
+
switch (environment) {
|
|
62
|
+
case RampsEnvironment.Production:
|
|
63
|
+
return 'https://on-ramp.api.cx.metamask.io';
|
|
64
|
+
case RampsEnvironment.Staging:
|
|
65
|
+
return 'https://on-ramp.uat-api.cx.metamask.io';
|
|
66
|
+
case RampsEnvironment.Development:
|
|
67
|
+
return 'https://on-ramp.dev-api.cx.metamask.io';
|
|
68
|
+
case RampsEnvironment.Local:
|
|
69
|
+
return 'http://localhost:3000';
|
|
70
|
+
default:
|
|
71
|
+
throw new Error(`Invalid environment: ${String(environment)}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Maps a Ramp API / MoonPay-shaped autoramp response into the local remote snapshot.
|
|
76
|
+
*
|
|
77
|
+
* @param response - Proxy response body.
|
|
78
|
+
* @returns Snapshot for the controller last-seen cursor.
|
|
79
|
+
*/
|
|
80
|
+
export function mapNeoBankAutorampToRemoteSnapshot(response) {
|
|
81
|
+
const depositRails = response.deposit_rails;
|
|
82
|
+
const hasDepositRails = Array.isArray(depositRails) && depositRails.length > 0;
|
|
83
|
+
const depositRailsSummary = hasDepositRails || response.status === 'Approved'
|
|
84
|
+
? {
|
|
85
|
+
ready: response.status === 'Approved' && hasDepositRails,
|
|
86
|
+
}
|
|
87
|
+
: undefined;
|
|
88
|
+
return {
|
|
89
|
+
id: response.id,
|
|
90
|
+
customerId: response.customer_id,
|
|
91
|
+
walletAddress: response.wallet_address !== undefined &&
|
|
92
|
+
response.wallet_address.length > 0
|
|
93
|
+
? response.wallet_address
|
|
94
|
+
: response.recipient_account?.address,
|
|
95
|
+
status: response.status,
|
|
96
|
+
depositRailsSummary,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Client for MetaMask Ramp API neo-bank endpoints (MoonPay Enterprise proxy).
|
|
101
|
+
*
|
|
102
|
+
* Lives alongside {@link RampsService} and {@link TransakService}. Authentication
|
|
103
|
+
* and MoonPay partner headers are handled by the Ramp API; this service only
|
|
104
|
+
* attaches the MetaMask user bearer token.
|
|
105
|
+
*
|
|
106
|
+
* Paths use the neobank-proxy `/neobank` prefix on the on-ramp.api host.
|
|
107
|
+
*/
|
|
108
|
+
export class NeoBankService {
|
|
109
|
+
name;
|
|
110
|
+
#messenger;
|
|
111
|
+
#fetch;
|
|
112
|
+
#policy;
|
|
113
|
+
#noRetryPolicy;
|
|
114
|
+
#environment;
|
|
115
|
+
#context;
|
|
116
|
+
#baseUrlOverride;
|
|
117
|
+
#walletRegistrationService;
|
|
118
|
+
constructor({ messenger, environment = RampsEnvironment.Staging, context, fetch: fetchFunction, policyOptions = {}, baseUrlOverride, }) {
|
|
119
|
+
this.name = serviceName;
|
|
120
|
+
this.#messenger = messenger;
|
|
121
|
+
this.#fetch = fetchFunction;
|
|
122
|
+
this.#policy = createServicePolicy({
|
|
123
|
+
retryFilterPolicy: handleWhen(isRetryableError),
|
|
124
|
+
...policyOptions,
|
|
125
|
+
});
|
|
126
|
+
this.#noRetryPolicy = createServicePolicy({
|
|
127
|
+
retryFilterPolicy: handleWhen(isRetryableError),
|
|
128
|
+
...policyOptions,
|
|
129
|
+
maxRetries: 0,
|
|
130
|
+
});
|
|
131
|
+
this.#environment = environment;
|
|
132
|
+
this.#context = context;
|
|
133
|
+
this.#baseUrlOverride = baseUrlOverride;
|
|
134
|
+
this.#messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
|
|
135
|
+
}
|
|
136
|
+
#getBaseUrl() {
|
|
137
|
+
if (this.#baseUrlOverride) {
|
|
138
|
+
return this.#baseUrlOverride;
|
|
139
|
+
}
|
|
140
|
+
return getBaseUrl(this.#environment);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Lazily builds the wallet registration client. Deferred so constructing the
|
|
144
|
+
* service never resolves the base URL eagerly (an invalid environment only
|
|
145
|
+
* throws when a request is made, matching the other neo-bank methods).
|
|
146
|
+
*
|
|
147
|
+
* @returns The wallet registration client.
|
|
148
|
+
*/
|
|
149
|
+
#getWalletRegistrationService() {
|
|
150
|
+
this.#walletRegistrationService ??= new WalletRegistrationService({
|
|
151
|
+
fetch: this.#fetch,
|
|
152
|
+
baseUrl: this.#getBaseUrl(),
|
|
153
|
+
getAuthToken: async () => this.#messenger.call('AuthenticationController:getBearerToken'),
|
|
154
|
+
getExternalId: async () => this.#getCanonicalExternalId(),
|
|
155
|
+
});
|
|
156
|
+
return this.#walletRegistrationService;
|
|
157
|
+
}
|
|
158
|
+
async #getRequestHeaders(options = {}) {
|
|
159
|
+
const bearerToken = await this.#messenger.call('AuthenticationController:getBearerToken');
|
|
160
|
+
const headers = {
|
|
161
|
+
Authorization: `Bearer ${bearerToken}`,
|
|
162
|
+
};
|
|
163
|
+
if (options.idempotencyKey) {
|
|
164
|
+
headers['Idempotency-Key'] = options.idempotencyKey;
|
|
165
|
+
}
|
|
166
|
+
return headers;
|
|
167
|
+
}
|
|
168
|
+
#buildUrl(path, query) {
|
|
169
|
+
const url = new URL(getNeoBankPath(path), this.#getBaseUrl());
|
|
170
|
+
url.searchParams.set('sdk', RAMPS_SDK_VERSION);
|
|
171
|
+
url.searchParams.set('controller', packageJson.version);
|
|
172
|
+
url.searchParams.set('context', this.#context);
|
|
173
|
+
if (query) {
|
|
174
|
+
for (const [key, value] of Object.entries(query)) {
|
|
175
|
+
if (value !== undefined && value !== null) {
|
|
176
|
+
url.searchParams.set(key, String(value));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return url;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Throws an {@link HttpError} that carries the upstream response body.
|
|
184
|
+
*
|
|
185
|
+
* The neobank-proxy mirrors MoonPay's status *and* body verbatim, so the
|
|
186
|
+
* body is usually the only place that explains a 4xx (e.g. which field or
|
|
187
|
+
* permission was rejected). Dropping it makes failures undiagnosable.
|
|
188
|
+
*
|
|
189
|
+
* @param url - Request URL, for context in the message.
|
|
190
|
+
* @param response - Non-OK fetch response.
|
|
191
|
+
*/
|
|
192
|
+
async #throwHttpError(url, response) {
|
|
193
|
+
let detail = '';
|
|
194
|
+
try {
|
|
195
|
+
const body = (await response.text()).trim();
|
|
196
|
+
if (body) {
|
|
197
|
+
detail = ` - ${body.slice(0, 500)}`;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// Body already consumed or unreadable; the status alone still helps.
|
|
202
|
+
}
|
|
203
|
+
throw new HttpError(response.status, `Fetching '${url.toString()}' failed with status '${response.status}'${detail}`);
|
|
204
|
+
}
|
|
205
|
+
async #getJson(path, query) {
|
|
206
|
+
const url = this.#buildUrl(path, query);
|
|
207
|
+
return this.#policy.execute(async () => {
|
|
208
|
+
const headers = await this.#getRequestHeaders();
|
|
209
|
+
const fetchResponse = await this.#fetch(url, { headers });
|
|
210
|
+
if (!fetchResponse.ok) {
|
|
211
|
+
await this.#throwHttpError(url, fetchResponse);
|
|
212
|
+
}
|
|
213
|
+
return fetchResponse.json();
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
async #postJson(path, body, options) {
|
|
217
|
+
const url = this.#buildUrl(path);
|
|
218
|
+
return this.#noRetryPolicy.execute(async () => {
|
|
219
|
+
const headers = await this.#getRequestHeaders(options);
|
|
220
|
+
headers['Content-Type'] = 'application/json';
|
|
221
|
+
const fetchResponse = await this.#fetch(url, {
|
|
222
|
+
method: 'POST',
|
|
223
|
+
headers,
|
|
224
|
+
body: JSON.stringify(body),
|
|
225
|
+
});
|
|
226
|
+
if (!fetchResponse.ok) {
|
|
227
|
+
await this.#throwHttpError(url, fetchResponse);
|
|
228
|
+
}
|
|
229
|
+
return fetchResponse.json();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
#mapAutorampResponse(response) {
|
|
233
|
+
if (!response || typeof response !== 'object' || !response.id) {
|
|
234
|
+
throw new Error('Malformed response received from neo-bank autoramp API');
|
|
235
|
+
}
|
|
236
|
+
return mapNeoBankAutorampToRemoteSnapshot(response);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Fetches an autoramp account via neobank-proxy
|
|
240
|
+
* `GET /neobank/autoramps/{autoramp_id}` (MoonPay
|
|
241
|
+
* `GET /api/autoramps/{autoramp_id}`).
|
|
242
|
+
*
|
|
243
|
+
* @param autorampId - MoonPay / Ramp API autoramp id.
|
|
244
|
+
* @returns Remote snapshot for controller apply/refresh.
|
|
245
|
+
*/
|
|
246
|
+
async getAutoramp(autorampId) {
|
|
247
|
+
const response = await this.#getJson(`autoramps/${encodeURIComponent(autorampId)}`);
|
|
248
|
+
return this.#mapAutorampResponse(response);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.
|
|
252
|
+
* Body is forwarded as opaque JSON (MoonPay address schema).
|
|
253
|
+
*
|
|
254
|
+
* @param body - Pix address registration payload.
|
|
255
|
+
* @param options - Optional idempotency key.
|
|
256
|
+
* @returns Parsed proxy JSON response.
|
|
257
|
+
*/
|
|
258
|
+
async registerPixAddress(body, options = {}) {
|
|
259
|
+
return this.#postJson('addresses/pix', body, options);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.
|
|
263
|
+
*
|
|
264
|
+
* @param query - Quote query params (forwarded as-is).
|
|
265
|
+
* @returns Parsed proxy JSON response.
|
|
266
|
+
*/
|
|
267
|
+
async getAutorampQuote(query = {}) {
|
|
268
|
+
return this.#getJson('autoramps/quote', query);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Creates an autoramp from a signed quote via neobank-proxy
|
|
272
|
+
* `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).
|
|
273
|
+
*
|
|
274
|
+
* @param body - CreateAutoramp / signed-quote payload (forwarded as-is).
|
|
275
|
+
* @param options - Optional idempotency key.
|
|
276
|
+
* @returns Remote snapshot for controller apply/refresh.
|
|
277
|
+
*/
|
|
278
|
+
async createAutoramp(body, options = {}) {
|
|
279
|
+
const response = await this.#postJson('autoramps', body, options);
|
|
280
|
+
return this.#mapAutorampResponse(response);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Fetches a quote for an existing autoramp via neobank-proxy
|
|
284
|
+
* `GET /neobank/autoramps/{autoramp_id}/quote`.
|
|
285
|
+
*
|
|
286
|
+
* @param autorampId - Autoramp id.
|
|
287
|
+
* @param query - Quote query params (forwarded as-is).
|
|
288
|
+
* @returns Parsed proxy JSON response.
|
|
289
|
+
*/
|
|
290
|
+
async getAutorampQuoteForAutoramp(autorampId, query = {}) {
|
|
291
|
+
return this.#getJson(`autoramps/${encodeURIComponent(autorampId)}/quote`, query);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Attaches a signed quote to an autoramp via neobank-proxy
|
|
295
|
+
* `POST /neobank/autoramps/{autoramp_id}/quotes`.
|
|
296
|
+
*
|
|
297
|
+
* @param autorampId - Autoramp id.
|
|
298
|
+
* @param body - Quote attachment payload (forwarded as-is).
|
|
299
|
+
* @param options - Optional idempotency key.
|
|
300
|
+
* @returns Parsed proxy JSON response.
|
|
301
|
+
*/
|
|
302
|
+
async attachAutorampQuote(autorampId, body, options = {}) {
|
|
303
|
+
return this.#postJson(`autoramps/${encodeURIComponent(autorampId)}/quotes`, body, options);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Fetches a customer by partner external id via neobank-proxy
|
|
307
|
+
* `GET /neobank/customers/{external_id}/external`.
|
|
308
|
+
*
|
|
309
|
+
* @param externalId - Partner-assigned external customer id.
|
|
310
|
+
* @returns Parsed proxy JSON response.
|
|
311
|
+
*/
|
|
312
|
+
async getCustomerByExternalId(externalId) {
|
|
313
|
+
return this.#getJson(`customers/${encodeURIComponent(externalId)}/external`);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Resolves Iron's internal customer id via neobank-proxy customer lookup,
|
|
317
|
+
* using the MetaMask canonical profile id as the partner `external_id`.
|
|
318
|
+
*
|
|
319
|
+
* @returns Iron's internal customer id.
|
|
320
|
+
*/
|
|
321
|
+
async getMoonpayCustomerId() {
|
|
322
|
+
return await this.#getWalletRegistrationService().getMoonpayCustomerId();
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Checks whether a Monad Money Account address is already registered for the
|
|
326
|
+
* given Iron customer.
|
|
327
|
+
*
|
|
328
|
+
* @param params - Customer id and address to check.
|
|
329
|
+
* @param params.customerId - Iron / MoonPay customer UUID.
|
|
330
|
+
* @param params.address - Money Account address.
|
|
331
|
+
* @returns Active, disabled, or absent registration status.
|
|
332
|
+
*/
|
|
333
|
+
async getWalletRegistrationStatus({ customerId, address, }) {
|
|
334
|
+
return await this.#getWalletRegistrationService().getRegistrationStatus({
|
|
335
|
+
customerId,
|
|
336
|
+
address,
|
|
337
|
+
blockchain: 'Monad',
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Submits a signed Monad Money Account ownership proof via neobank-proxy
|
|
342
|
+
* `POST /neobank/addresses/crypto/selfhosted`.
|
|
343
|
+
*
|
|
344
|
+
* @param params - Signed ownership proof.
|
|
345
|
+
* @returns Registered wallet record.
|
|
346
|
+
*/
|
|
347
|
+
async registerSelfHostedWallet(params) {
|
|
348
|
+
return await this.#getWalletRegistrationService().registerSelfHostedWallet({
|
|
349
|
+
...params,
|
|
350
|
+
blockchain: 'Monad',
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Resolves the MetaMask canonical profile id used as MoonPay's partner
|
|
355
|
+
* `external_id` for neobank customer lookup.
|
|
356
|
+
*
|
|
357
|
+
* @returns Canonical profile id.
|
|
358
|
+
*/
|
|
359
|
+
async #getCanonicalExternalId() {
|
|
360
|
+
const profile = await this.#messenger.call('AuthenticationController:getSessionProfile');
|
|
361
|
+
const canonical = profile?.canonicalProfileId;
|
|
362
|
+
const externalId = typeof canonical === 'string' && canonical.length > 0
|
|
363
|
+
? canonical
|
|
364
|
+
: profile?.profileId;
|
|
365
|
+
if (typeof externalId !== 'string' || externalId.length === 0) {
|
|
366
|
+
throw new Error('Unable to resolve MetaMask canonical profile id for MoonPay customer lookup');
|
|
367
|
+
}
|
|
368
|
+
return externalId;
|
|
369
|
+
}
|
|
370
|
+
onRetry(listener) {
|
|
371
|
+
return this.#policy.onRetry(listener);
|
|
372
|
+
}
|
|
373
|
+
onBreak(listener) {
|
|
374
|
+
return this.#policy.onBreak(listener);
|
|
375
|
+
}
|
|
376
|
+
onDegraded(listener) {
|
|
377
|
+
return this.#policy.onDegraded(listener);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
//# sourceMappingURL=NeoBankService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeoBankService.js","sourceRoot":"","sources":["../src/NeoBankService.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,SAAS,GACV,MAAM,4BAA4B,CAAC;AAIpC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAM7E;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,SAAS,gBAAgB,CAAC,KAAc;IACtC,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,UAAU,GAAG,GAAG,IAAI,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AC,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;QACJ,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,CACL,QAAiD;QAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CACL,QAAiD;QAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,UAAU,CACR,QAAoD;QAEpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport {\n createServicePolicy,\n handleWhen,\n HttpError,\n} from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\n\nimport packageJson from '../package.json';\nimport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\nimport type { NeoBankServiceMethodActions } from './NeoBankService-method-action-types.js';\nimport { RAMPS_SDK_VERSION, RampsEnvironment } from './RampsService.js';\nimport { WalletRegistrationService } from './wallet-registration-service.js';\nimport type {\n RegistrationOutcome,\n RegistrationStatus,\n} from './wallet-registration-service.js';\n\n/**\n * Name of the NeoBankService messenger namespace.\n */\nexport const serviceName = 'NeoBankService';\n\n/**\n * Determines whether a failed neo-bank request is worth re-issuing.\n *\n * 4xx responses describe the request or the account's state (e.g. 403\n * \"Customer is not active\", 422 validation), so repeating them only multiplies\n * the same rejection. 429 stays retryable alongside 5xx and non-HTTP\n * network/timeout errors.\n *\n * @param error - Error thrown while performing the request.\n * @returns `true` when the error is worth retrying.\n */\nfunction isRetryableError(error: unknown): boolean {\n if (error instanceof HttpError) {\n if (error.httpStatus === 429) {\n return true;\n }\n return error.httpStatus < 400 || error.httpStatus >= 500;\n }\n return true;\n}\n\n/**\n * Raw autoramp payload from the MetaMask Ramp API neo-bank proxy.\n * Shape mirrors MoonPay Enterprise `GET /api/autoramps/{autoramp_id}`.\n * The Ramp API handles partner auth / headers; the client only sends the\n * MetaMask bearer token.\n */\nexport type NeoBankAutorampResponse = {\n id: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n customer_id?: string;\n status: string;\n /**\n * Destination wallet when present on the proxy response.\n * Field name may evolve with the Ramp API contract.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n wallet_address?: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n recipient_account?: {\n address?: string;\n };\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n deposit_rails?: unknown[];\n};\n\n/**\n * Optional headers for neo-bank mutating requests.\n */\nexport type NeoBankRequestOptions = {\n /**\n * Forwarded as `Idempotency-Key` when set (MoonPay requires it on some POSTs;\n * neobank-proxy generates one when omitted).\n */\n idempotencyKey?: string;\n};\n\n/**\n * Query string values accepted by neo-bank GET helpers.\n */\nexport type NeoBankQueryParams = Record<\n string,\n string | number | boolean | undefined | null\n>;\n\nexport type GetWalletRegistrationStatusParams = {\n customerId: string;\n address: string;\n};\n\nexport type RegisterSelfHostedWalletParams = {\n customerId: string;\n address: string;\n message: string;\n signature: string;\n /**\n * Forwarded as `Idempotency-Key` on the neobank-proxy POST. Prefer a stable\n * key across retries of the same ownership body.\n */\n idempotencyKey?: string;\n};\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getAutoramp',\n 'registerPixAddress',\n 'getAutorampQuote',\n 'createAutoramp',\n 'getAutorampQuoteForAutoramp',\n 'attachAutorampQuote',\n 'getCustomerByExternalId',\n 'getMoonpayCustomerId',\n 'getWalletRegistrationStatus',\n 'registerSelfHostedWallet',\n] as const;\n\n/**\n * Actions that {@link NeoBankService} exposes to other consumers.\n */\nexport type NeoBankServiceActions = NeoBankServiceMethodActions;\n\ntype AllowedActions =\n | AuthenticationController.AuthenticationControllerGetBearerTokenAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction;\n\nexport type NeoBankServiceEvents = never;\n\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link NeoBankService}.\n */\nexport type NeoBankServiceMessenger = Messenger<\n typeof serviceName,\n NeoBankServiceActions | AllowedActions,\n NeoBankServiceEvents | AllowedEvents\n>;\n\n/**\n * Builds a path under the neobank-proxy global prefix.\n *\n * Live neobank-proxy (#1124) mounts routes at `/neobank` on the on-ramp.api\n * host (ALB path routing, no rewrite). Prefer this over `/api/v2/...` so Core\n * matches the proxy that ships.\n *\n * @param path - Path under `/neobank` (no leading slash).\n * @returns Absolute path segment for URL join against the Ramp API host.\n */\nfunction getNeoBankPath(path: string): string {\n return `neobank/${path.replace(/^\\//u, '')}`;\n}\n\n/**\n * Resolves the Ramp API host for neo-bank calls (same hosts as {@link RampsService}).\n *\n * @param environment - Ramp environment.\n * @returns Base URL.\n */\nfunction getBaseUrl(environment: RampsEnvironment): string {\n switch (environment) {\n case RampsEnvironment.Production:\n return 'https://on-ramp.api.cx.metamask.io';\n case RampsEnvironment.Staging:\n return 'https://on-ramp.uat-api.cx.metamask.io';\n case RampsEnvironment.Development:\n return 'https://on-ramp.dev-api.cx.metamask.io';\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Maps a Ramp API / MoonPay-shaped autoramp response into the local remote snapshot.\n *\n * @param response - Proxy response body.\n * @returns Snapshot for the controller last-seen cursor.\n */\nexport function mapNeoBankAutorampToRemoteSnapshot(\n response: NeoBankAutorampResponse,\n): AutorampRemoteSnapshot {\n const depositRails = response.deposit_rails;\n const hasDepositRails =\n Array.isArray(depositRails) && depositRails.length > 0;\n const depositRailsSummary: AutorampDepositRailsSummary | undefined =\n hasDepositRails || response.status === 'Approved'\n ? {\n ready: response.status === 'Approved' && hasDepositRails,\n }\n : undefined;\n\n return {\n id: response.id,\n customerId: response.customer_id,\n walletAddress:\n response.wallet_address !== undefined &&\n response.wallet_address.length > 0\n ? response.wallet_address\n : response.recipient_account?.address,\n status: response.status,\n depositRailsSummary,\n };\n}\n\n/**\n * Client for MetaMask Ramp API neo-bank endpoints (MoonPay Enterprise proxy).\n *\n * Lives alongside {@link RampsService} and {@link TransakService}. Authentication\n * and MoonPay partner headers are handled by the Ramp API; this service only\n * attaches the MetaMask user bearer token.\n *\n * Paths use the neobank-proxy `/neobank` prefix on the on-ramp.api host.\n */\nexport class NeoBankService {\n readonly name: typeof serviceName;\n\n readonly #messenger: NeoBankServiceMessenger;\n\n readonly #fetch: typeof fetch;\n\n readonly #policy: ServicePolicy;\n\n readonly #noRetryPolicy: ServicePolicy;\n\n readonly #environment: RampsEnvironment;\n\n readonly #context: string;\n\n readonly #baseUrlOverride?: string;\n\n #walletRegistrationService: WalletRegistrationService | undefined;\n\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: NeoBankServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy({\n retryFilterPolicy: handleWhen(isRetryableError),\n ...policyOptions,\n });\n this.#noRetryPolicy = createServicePolicy({\n retryFilterPolicy: handleWhen(isRetryableError),\n ...policyOptions,\n maxRetries: 0,\n });\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #getBaseUrl(): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment);\n }\n\n /**\n * Lazily builds the wallet registration client. Deferred so constructing the\n * service never resolves the base URL eagerly (an invalid environment only\n * throws when a request is made, matching the other neo-bank methods).\n *\n * @returns The wallet registration client.\n */\n #getWalletRegistrationService(): WalletRegistrationService {\n this.#walletRegistrationService ??= new WalletRegistrationService({\n fetch: this.#fetch,\n baseUrl: this.#getBaseUrl(),\n getAuthToken: async (): Promise<string> =>\n this.#messenger.call('AuthenticationController:getBearerToken'),\n getExternalId: async (): Promise<string> =>\n this.#getCanonicalExternalId(),\n });\n return this.#walletRegistrationService;\n }\n\n async #getRequestHeaders(\n options: NeoBankRequestOptions = {},\n ): Promise<Record<string, string>> {\n const bearerToken = await this.#messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n const headers: Record<string, string> = {\n Authorization: `Bearer ${bearerToken}`,\n };\n if (options.idempotencyKey) {\n headers['Idempotency-Key'] = options.idempotencyKey;\n }\n return headers;\n }\n\n #buildUrl(path: string, query?: NeoBankQueryParams): URL {\n const url = new URL(getNeoBankPath(path), this.#getBaseUrl());\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n return url;\n }\n\n /**\n * Throws an {@link HttpError} that carries the upstream response body.\n *\n * The neobank-proxy mirrors MoonPay's status *and* body verbatim, so the\n * body is usually the only place that explains a 4xx (e.g. which field or\n * permission was rejected). Dropping it makes failures undiagnosable.\n *\n * @param url - Request URL, for context in the message.\n * @param response - Non-OK fetch response.\n */\n async #throwHttpError(url: URL, response: Response): Promise<never> {\n let detail = '';\n try {\n const body = (await response.text()).trim();\n if (body) {\n detail = ` - ${body.slice(0, 500)}`;\n }\n } catch {\n // Body already consumed or unreadable; the status alone still helps.\n }\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'${detail}`,\n );\n }\n\n async #getJson<ResponseBody>(\n path: string,\n query?: NeoBankQueryParams,\n ): Promise<ResponseBody> {\n const url = this.#buildUrl(path, query);\n return this.#policy.execute(async () => {\n const headers = await this.#getRequestHeaders();\n const fetchResponse = await this.#fetch(url, { headers });\n if (!fetchResponse.ok) {\n await this.#throwHttpError(url, fetchResponse);\n }\n return fetchResponse.json() as Promise<ResponseBody>;\n });\n }\n\n async #postJson<ResponseBody>(\n path: string,\n body: Record<string, unknown>,\n options: NeoBankRequestOptions,\n ): Promise<ResponseBody> {\n const url = this.#buildUrl(path);\n return this.#noRetryPolicy.execute(async () => {\n const headers = await this.#getRequestHeaders(options);\n headers['Content-Type'] = 'application/json';\n const fetchResponse = await this.#fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n });\n if (!fetchResponse.ok) {\n await this.#throwHttpError(url, fetchResponse);\n }\n return fetchResponse.json() as Promise<ResponseBody>;\n });\n }\n\n #mapAutorampResponse(\n response: NeoBankAutorampResponse,\n ): AutorampRemoteSnapshot {\n if (!response || typeof response !== 'object' || !response.id) {\n throw new Error('Malformed response received from neo-bank autoramp API');\n }\n return mapNeoBankAutorampToRemoteSnapshot(response);\n }\n\n /**\n * Fetches an autoramp account via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}` (MoonPay\n * `GET /api/autoramps/{autoramp_id}`).\n *\n * @param autorampId - MoonPay / Ramp API autoramp id.\n * @returns Remote snapshot for controller apply/refresh.\n */\n async getAutoramp(autorampId: string): Promise<AutorampRemoteSnapshot> {\n const response = await this.#getJson<NeoBankAutorampResponse>(\n `autoramps/${encodeURIComponent(autorampId)}`,\n );\n return this.#mapAutorampResponse(response);\n }\n\n /**\n * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.\n * Body is forwarded as opaque JSON (MoonPay address schema).\n *\n * @param body - Pix address registration payload.\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\n async registerPixAddress(\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<unknown> {\n return this.#postJson('addresses/pix', body, options);\n }\n\n /**\n * Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.\n *\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\n async getAutorampQuote(query: NeoBankQueryParams = {}): Promise<unknown> {\n return this.#getJson('autoramps/quote', query);\n }\n\n /**\n * Creates an autoramp from a signed quote via neobank-proxy\n * `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).\n *\n * @param body - CreateAutoramp / signed-quote payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Remote snapshot for controller apply/refresh.\n */\n async createAutoramp(\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<AutorampRemoteSnapshot> {\n const response = await this.#postJson<NeoBankAutorampResponse>(\n 'autoramps',\n body,\n options,\n );\n return this.#mapAutorampResponse(response);\n }\n\n /**\n * Fetches a quote for an existing autoramp via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}/quote`.\n *\n * @param autorampId - Autoramp id.\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\n async getAutorampQuoteForAutoramp(\n autorampId: string,\n query: NeoBankQueryParams = {},\n ): Promise<unknown> {\n return this.#getJson(\n `autoramps/${encodeURIComponent(autorampId)}/quote`,\n query,\n );\n }\n\n /**\n * Attaches a signed quote to an autoramp via neobank-proxy\n * `POST /neobank/autoramps/{autoramp_id}/quotes`.\n *\n * @param autorampId - Autoramp id.\n * @param body - Quote attachment payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\n async attachAutorampQuote(\n autorampId: string,\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<unknown> {\n return this.#postJson(\n `autoramps/${encodeURIComponent(autorampId)}/quotes`,\n body,\n options,\n );\n }\n\n /**\n * Fetches a customer by partner external id via neobank-proxy\n * `GET /neobank/customers/{external_id}/external`.\n *\n * @param externalId - Partner-assigned external customer id.\n * @returns Parsed proxy JSON response.\n */\n async getCustomerByExternalId(externalId: string): Promise<unknown> {\n return this.#getJson(\n `customers/${encodeURIComponent(externalId)}/external`,\n );\n }\n\n /**\n * Resolves Iron's internal customer id via neobank-proxy customer lookup,\n * using the MetaMask canonical profile id as the partner `external_id`.\n *\n * @returns Iron's internal customer id.\n */\n async getMoonpayCustomerId(): Promise<string> {\n return await this.#getWalletRegistrationService().getMoonpayCustomerId();\n }\n\n /**\n * Checks whether a Monad Money Account address is already registered for the\n * given Iron customer.\n *\n * @param params - Customer id and address to check.\n * @param params.customerId - Iron / MoonPay customer UUID.\n * @param params.address - Money Account address.\n * @returns Active, disabled, or absent registration status.\n */\n async getWalletRegistrationStatus({\n customerId,\n address,\n }: GetWalletRegistrationStatusParams): Promise<RegistrationStatus> {\n return await this.#getWalletRegistrationService().getRegistrationStatus({\n customerId,\n address,\n blockchain: 'Monad',\n });\n }\n\n /**\n * Submits a signed Monad Money Account ownership proof via neobank-proxy\n * `POST /neobank/addresses/crypto/selfhosted`.\n *\n * @param params - Signed ownership proof.\n * @returns Registered wallet record.\n */\n async registerSelfHostedWallet(\n params: RegisterSelfHostedWalletParams,\n ): Promise<RegistrationOutcome> {\n return await this.#getWalletRegistrationService().registerSelfHostedWallet({\n ...params,\n blockchain: 'Monad',\n });\n }\n\n /**\n * Resolves the MetaMask canonical profile id used as MoonPay's partner\n * `external_id` for neobank customer lookup.\n *\n * @returns Canonical profile id.\n */\n async #getCanonicalExternalId(): Promise<string> {\n const profile = await this.#messenger.call(\n 'AuthenticationController:getSessionProfile',\n );\n const canonical = profile?.canonicalProfileId;\n const externalId =\n typeof canonical === 'string' && canonical.length > 0\n ? canonical\n : profile?.profileId;\n if (typeof externalId !== 'string' || externalId.length === 0) {\n throw new Error(\n 'Unable to resolve MetaMask canonical profile id for MoonPay customer lookup',\n );\n }\n return externalId;\n }\n\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n}\n"]}
|
package/dist/{RampsController-method-action-types.d.mts → RampsController-method-action-types.d.ts}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file is auto generated.
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
*/
|
|
5
|
-
import type { RampsController } from
|
|
5
|
+
import type { RampsController } from './RampsController.js';
|
|
6
6
|
/**
|
|
7
7
|
* Executes a request with caching, deduplication, and at most one in-flight
|
|
8
8
|
* request per resource type.
|
|
@@ -305,6 +305,96 @@ export type RampsControllerRemoveOrderAction = {
|
|
|
305
305
|
type: `RampsController:removeOrder`;
|
|
306
306
|
handler: RampsController['removeOrder'];
|
|
307
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Adds or updates a local autoramp last-seen cursor (e.g. after create).
|
|
310
|
+
*
|
|
311
|
+
* @param accountOrInput - Full account or create fields.
|
|
312
|
+
* @returns The upserted {@link AutorampAccount}.
|
|
313
|
+
*/
|
|
314
|
+
export type RampsControllerAddAutorampAction = {
|
|
315
|
+
type: `RampsController:addAutoramp`;
|
|
316
|
+
handler: RampsController['addAutoramp'];
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Creates an autoramp via the neo-bank proxy and applies the returned
|
|
320
|
+
* snapshot as the local last-seen cursor.
|
|
321
|
+
*
|
|
322
|
+
* The vendor `customer_id` is resolved via
|
|
323
|
+
* {@link RampsController.resolveAutorampCustomerId} and injected into the
|
|
324
|
+
* request (any caller-supplied `customer_id` is overwritten).
|
|
325
|
+
*
|
|
326
|
+
* @param request - CreateAutoramp payload.
|
|
327
|
+
* @param options - Optional idempotency key forwarded to the proxy.
|
|
328
|
+
* @param options.idempotencyKey - Value sent as `Idempotency-Key`.
|
|
329
|
+
* @returns The created/updated local {@link AutorampAccount}.
|
|
330
|
+
*/
|
|
331
|
+
export type RampsControllerCreateAutorampAction = {
|
|
332
|
+
type: `RampsController:createAutoramp`;
|
|
333
|
+
handler: RampsController['createAutoramp'];
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* Registers a Money Account wallet with MoonPay Iron via neobank-proxy.
|
|
337
|
+
*
|
|
338
|
+
* @param params - Money Account wallet registration parameters.
|
|
339
|
+
* @param params.address - Monad Money Account address.
|
|
340
|
+
* @returns The registration state, or `{ type: 'lookupUnavailable' }` when
|
|
341
|
+
* the address-list lookup fails (never treated as unregistered).
|
|
342
|
+
*/
|
|
343
|
+
export type RampsControllerRegisterMoneyAccountWalletAction = {
|
|
344
|
+
type: `RampsController:registerMoneyAccountWallet`;
|
|
345
|
+
handler: RampsController['registerMoneyAccountWallet'];
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* Removes a local autoramp last-seen cursor by id.
|
|
349
|
+
*
|
|
350
|
+
* @param autorampId - MoonPay autoramp id.
|
|
351
|
+
*/
|
|
352
|
+
export type RampsControllerRemoveAutorampAction = {
|
|
353
|
+
type: `RampsController:removeAutoramp`;
|
|
354
|
+
handler: RampsController['removeAutoramp'];
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Marks that the UI has already notified for the autoramp's current status.
|
|
358
|
+
*
|
|
359
|
+
* @param autorampId - MoonPay autoramp id.
|
|
360
|
+
*/
|
|
361
|
+
export type RampsControllerMarkAutorampAsNotifiedAction = {
|
|
362
|
+
type: `RampsController:markAutorampAsNotified`;
|
|
363
|
+
handler: RampsController['markAutorampAsNotified'];
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Applies a remote autoramp snapshot from a websocket / webhook push.
|
|
367
|
+
*
|
|
368
|
+
* @param remote - Remote autoramp snapshot.
|
|
369
|
+
* @returns The updated local account.
|
|
370
|
+
*/
|
|
371
|
+
export type RampsControllerApplyAutorampStatusFromPushAction = {
|
|
372
|
+
type: `RampsController:applyAutorampStatusFromPush`;
|
|
373
|
+
handler: RampsController['applyAutorampStatusFromPush'];
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Fetches one autoramp from the neo-bank proxy and applies it to the
|
|
377
|
+
* last-seen cursor. Does not recreate a cursor that was removed while the
|
|
378
|
+
* request was in flight.
|
|
379
|
+
*
|
|
380
|
+
* @param autorampId - MoonPay autoramp id.
|
|
381
|
+
* @returns The updated local account, or an unpersisted snapshot if the
|
|
382
|
+
* cursor was removed during the fetch.
|
|
383
|
+
*/
|
|
384
|
+
export type RampsControllerRefreshAutorampAction = {
|
|
385
|
+
type: `RampsController:refreshAutoramp`;
|
|
386
|
+
handler: RampsController['refreshAutoramp'];
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* Refreshes all known local autoramps from MoonPay.
|
|
390
|
+
* Intended for app resume / unlock catch-up when webhooks were missed.
|
|
391
|
+
*
|
|
392
|
+
* @returns Updated autoramp accounts (failed fetches are skipped).
|
|
393
|
+
*/
|
|
394
|
+
export type RampsControllerRefreshAutorampsAction = {
|
|
395
|
+
type: `RampsController:refreshAutoramps`;
|
|
396
|
+
handler: RampsController['refreshAutoramps'];
|
|
397
|
+
};
|
|
308
398
|
/**
|
|
309
399
|
* Starts polling all pending V2 orders at a fixed interval.
|
|
310
400
|
* Each poll cycle iterates orders with non-terminal statuses,
|
|
@@ -664,5 +754,5 @@ export type RampsControllerTransakGetActiveOrdersAction = {
|
|
|
664
754
|
/**
|
|
665
755
|
* Union of all RampsController action types.
|
|
666
756
|
*/
|
|
667
|
-
export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerSetSelectedProviderForAssetAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerGetPaymentMethodsForContextAction | 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 | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
|
|
668
|
-
//# sourceMappingURL=RampsController-method-action-types.d.
|
|
757
|
+
export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerSetSelectedProviderForAssetAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerGetPaymentMethodsForContextAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerAddAutorampAction | RampsControllerCreateAutorampAction | RampsControllerRegisterMoneyAccountWalletAction | RampsControllerRemoveAutorampAction | RampsControllerMarkAutorampAsNotifiedAction | RampsControllerApplyAutorampStatusFromPushAction | RampsControllerRefreshAutorampAction | RampsControllerRefreshAutorampsAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
|
|
758
|
+
//# sourceMappingURL=RampsController-method-action-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RampsController-method-action-types.d.ts","sourceRoot":"","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