Skip to content

Commit 7b2eff0

Browse files
committed
Disable Infinite
Pending Master Services Agreement approval
1 parent bd585b7 commit 7b2eff0

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/plugins/ramps/infinite/infiniteRampPlugin.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { getContractAddress } from '../../../util/CurrencyInfoHelpers'
77
import { removeIsoPrefix } from '../../../util/utils'
88
import type { EdgeVault } from '../../../util/vault/edgeVault'
99
import { makeEdgeVault } from '../../../util/vault/edgeVault'
10+
import type { FiatPaymentType } from '../../gui/fiatPluginTypes'
1011
import { FiatProviderError } from '../../gui/fiatProviderTypes'
1112
import 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'
2126
import { handleExitErrorsGracefully } from '../utils/exitUtils'
2227
import { makeInfiniteApi } from './infiniteApi'
2328
import 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

src/plugins/ramps/rampConstraints.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,9 @@ export function* constraintGenerator(
9494
if (params.rampPluginId === 'banxa') {
9595
yield params.paymentType !== 'ach'
9696
}
97+
98+
// Disable Infinite pending Master Services Agreement approval
99+
if (params.rampPluginId === 'infinite') {
100+
yield false
101+
}
97102
}

0 commit comments

Comments
 (0)