Skip to content

Commit 0e87220

Browse files
committed
fixup! feat(ramp): add new plugin architecture for fiat on/off ramps
1 parent c213502 commit 0e87220

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/scenes/TradeCreateScene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const TradeCreateScene: React.FC<Props> = (props: Props) => {
207207
tokenId: selectedCrypto?.tokenId ?? null,
208208
displayCurrencyCode: selectedCryptoCurrencyCode,
209209
exchangeAmount: userInput,
210-
fiatCurrencyCode: `iso:${selectedFiatCurrencyCode}`,
210+
fiatCurrencyCode: selectedFiatCurrencyCode,
211211
amountType: lastUsedInput,
212212
direction: 'buy',
213213
regionCode: {

src/plugins/ramps/paybis/paybisRampPlugin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ interface ExtendedTokenId extends EdgeAsset {
223223
currencyCode?: string
224224
}
225225

226+
const ensureIsoPrefix = (currencyCode: string): string => {
227+
return currencyCode.startsWith('iso:') ? currencyCode : `iso:${currencyCode}`
228+
}
229+
226230
const FIAT_DECIMALS = -2
227231
const CRYPTO_DECIMALS = -8
228232

@@ -690,7 +694,7 @@ export const paybisRampPlugin: RampPluginFactory = (
690694
// Check asset support
691695
const assetResult = checkAssetSupport(
692696
direction,
693-
`iso:${fiatAsset.currencyCode}`,
697+
ensureIsoPrefix(fiatAsset.currencyCode),
694698
cryptoAsset
695699
)
696700
if (assetResult != null) {
@@ -772,7 +776,7 @@ export const paybisRampPlugin: RampPluginFactory = (
772776
}
773777
const assetResult = checkAssetSupport(
774778
direction,
775-
fiatCurrencyCode,
779+
ensureIsoPrefix(fiatCurrencyCode),
776780
cryptoAsset
777781
)
778782
if (assetResult != null) {

0 commit comments

Comments
 (0)