@@ -7,6 +7,7 @@ import { getContractAddress } from '../../../util/CurrencyInfoHelpers'
77import { removeIsoPrefix } from '../../../util/utils'
88import type { EdgeVault } from '../../../util/vault/edgeVault'
99import { makeEdgeVault } from '../../../util/vault/edgeVault'
10+ import type { FiatPaymentType } from '../../gui/fiatPluginTypes'
1011import { FiatProviderError } from '../../gui/fiatProviderTypes'
1112import type {
1213 RampApproveQuoteParams ,
@@ -18,6 +19,10 @@ import type {
1819 RampQuoteRequest ,
1920 RampSupportResult
2021} from '../rampPluginTypes'
22+ import {
23+ validateRampCheckSupportRequest ,
24+ validateRampQuoteRequest
25+ } from '../utils/constraintUtils'
2126import { handleExitErrorsGracefully } from '../utils/exitUtils'
2227import { makeInfiniteApi } from './infiniteApi'
2328import type {
@@ -189,6 +194,15 @@ export const infiniteRampPlugin: RampPluginFactory = (
189194 return { supported : false }
190195 }
191196
197+ // Global constraints pre-check
198+ const paymentTypes : FiatPaymentType [ ] = [ 'wire' ]
199+ const constraintOk = validateRampCheckSupportRequest (
200+ pluginId ,
201+ request ,
202+ paymentTypes
203+ )
204+ if ( ! constraintOk ) return { supported : false }
205+
192206 // Check crypto network support first
193207 const infiniteNetwork = getInfiniteNetwork ( cryptoAsset . pluginId )
194208 if ( infiniteNetwork == null ) {
@@ -284,6 +298,14 @@ export const infiniteRampPlugin: RampPluginFactory = (
284298 } ,
285299
286300 fetchQuotes : async ( request : RampQuoteRequest ) : Promise < RampQuote [ ] > => {
301+ // Global constraints pre-check for quote requests
302+ const quoteConstraintOk = validateRampQuoteRequest (
303+ pluginId ,
304+ request ,
305+ 'wire'
306+ )
307+ if ( ! quoteConstraintOk ) return [ ]
308+
287309 const currencyPluginId = request . wallet . currencyInfo . pluginId
288310
289311 // Only support fiat amounts for now
0 commit comments