Skip to content

Commit 0793a2c

Browse files
committed
More fixups
1 parent 0d655fa commit 0793a2c

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

src/plugins/ramps/bity/bityRampPlugin.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ import { showError } from '../../../components/services/AirshipInstance'
2323
import { EDGE_CONTENT_SERVER_URI } from '../../../constants/CdnConstants'
2424
import { lstrings } from '../../../locales/strings'
2525
import type { HomeAddress, SepaInfo } from '../../../types/FormTypes'
26+
import type { NavigationBase } from '../../../types/routerTypes'
2627
import type { StringMap } from '../../../types/types'
28+
import { CryptoAmount } from '../../../util/CryptoAmount'
2729
import {
2830
getCurrencyCodeMultiplier,
2931
getTokenId
3032
} from '../../../util/CurrencyInfoHelpers'
3133
import { utf8 } from '../../../util/encoding'
34+
import type { OnLogEvent } from '../../../util/tracking'
3235
import { removeIsoPrefix } from '../../../util/utils'
3336
import {
3437
SendErrorBackPressed,
@@ -1001,9 +1004,9 @@ export const bityRampPlugin = (pluginConfig: RampPluginConfig): RampPlugin => {
10011004
const completeSellOrder = async (
10021005
approveQuoteRes: BityApproveQuoteResponse,
10031006
coreWallet: EdgeCurrencyWallet,
1004-
navigation: any,
1005-
account: any,
1006-
onLogEvent: any,
1007+
navigation: NavigationBase,
1008+
account: EdgeAccount,
1009+
onLogEvent: OnLogEvent,
10071010
fiatCurrencyCode: string,
10081011
tokenId: EdgeTokenId
10091012
): Promise<void> => {
@@ -1099,21 +1102,24 @@ const completeSellOrder = async (
10991102
conversionType: 'sell',
11001103
destFiatCurrencyCode: fiatCurrencyCode,
11011104
destFiatAmount: fiatAmount,
1105+
sourceAmount: new CryptoAmount({
1106+
currencyConfig: coreWallet.currencyConfig,
1107+
tokenId,
1108+
nativeAmount
1109+
}),
11021110
fiatProviderId: pluginId,
11031111
orderId: id
11041112
}
11051113
})
11061114

11071115
// Save tx action
1108-
if (tokenId != null) {
1109-
const params = {
1110-
walletId: coreWallet.id,
1111-
tokenId,
1116+
if (spendInfo.savedAction != null && spendInfo.assetAction != null) {
1117+
await coreWallet.saveTxAction({
11121118
txid: tx.txid,
1113-
savedAction: spendInfo.savedAction,
1114-
assetAction: spendInfo.assetAction
1115-
}
1116-
await account.currencyWallets[coreWallet.id].saveTxAction(params)
1119+
tokenId,
1120+
assetAction: spendInfo.assetAction,
1121+
savedAction: spendInfo.savedAction
1122+
})
11171123
}
11181124
}
11191125

@@ -1123,7 +1129,7 @@ const completeSellOrder = async (
11231129
*/
11241130
const completeBuyOrder = async (
11251131
approveQuoteRes: BityApproveQuoteResponse,
1126-
navigation: any
1132+
navigation: NavigationBase
11271133
): Promise<void> => {
11281134
const {
11291135
input,
@@ -1135,7 +1141,7 @@ const completeBuyOrder = async (
11351141
const { iban, swift_bic: swiftBic, recipient, reference } = paymentDetails
11361142

11371143
await new Promise<void>((resolve, reject) => {
1138-
navigation.navigate('guiPluginSepaTransferInfo', {
1144+
navigation.navigate('guiPluginInfoDisplay', {
11391145
headerTitle: lstrings.payment_details,
11401146
promptMessage: sprintf(lstrings.sepa_transfer_prompt_s, id),
11411147
transferInfo: {

src/plugins/ramps/moonpay/moonpayRampPlugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import {
6969
asMoonpayCurrency,
7070
asMoonpayQuote,
7171
type MoonpayBuyWidgetQueryParams,
72+
type MoonpayCurrency,
7273
type MoonpayPaymentMethod,
7374
type MoonpaySellWidgetQueryParams
7475
} from './moonpayRampTypes'
@@ -385,7 +386,7 @@ export const moonpayRampPlugin: RampPluginFactory = (
385386
const isFiatSupported = (
386387
fiatCurrencyCode: string,
387388
assetMap: AssetMap
388-
): any | null => {
389+
): MoonpayCurrency | null => {
389390
const fiatCurrencyObj = assetMap.fiat[fiatCurrencyCode]
390391
if (fiatCurrencyObj == null) {
391392
return null
@@ -531,7 +532,7 @@ export const moonpayRampPlugin: RampPluginFactory = (
531532
paymentMethod: MoonpayPaymentMethod
532533
assetMap: AssetMap
533534
moonpayCurrency: ProviderToken
534-
fiatCurrencyObj: any
535+
fiatCurrencyObj: MoonpayCurrency
535536
} | null = null
536537

537538
for (const method of supportedPaymentMethods) {

0 commit comments

Comments
 (0)