@@ -23,12 +23,15 @@ import { showError } from '../../../components/services/AirshipInstance'
23
23
import { EDGE_CONTENT_SERVER_URI } from '../../../constants/CdnConstants'
24
24
import { lstrings } from '../../../locales/strings'
25
25
import type { HomeAddress , SepaInfo } from '../../../types/FormTypes'
26
+ import type { NavigationBase } from '../../../types/routerTypes'
26
27
import type { StringMap } from '../../../types/types'
28
+ import { CryptoAmount } from '../../../util/CryptoAmount'
27
29
import {
28
30
getCurrencyCodeMultiplier ,
29
31
getTokenId
30
32
} from '../../../util/CurrencyInfoHelpers'
31
33
import { utf8 } from '../../../util/encoding'
34
+ import type { OnLogEvent } from '../../../util/tracking'
32
35
import { removeIsoPrefix } from '../../../util/utils'
33
36
import {
34
37
SendErrorBackPressed ,
@@ -1001,9 +1004,9 @@ export const bityRampPlugin = (pluginConfig: RampPluginConfig): RampPlugin => {
1001
1004
const completeSellOrder = async (
1002
1005
approveQuoteRes : BityApproveQuoteResponse ,
1003
1006
coreWallet : EdgeCurrencyWallet ,
1004
- navigation : any ,
1005
- account : any ,
1006
- onLogEvent : any ,
1007
+ navigation : NavigationBase ,
1008
+ account : EdgeAccount ,
1009
+ onLogEvent : OnLogEvent ,
1007
1010
fiatCurrencyCode : string ,
1008
1011
tokenId : EdgeTokenId
1009
1012
) : Promise < void > => {
@@ -1099,21 +1102,24 @@ const completeSellOrder = async (
1099
1102
conversionType : 'sell' ,
1100
1103
destFiatCurrencyCode : fiatCurrencyCode ,
1101
1104
destFiatAmount : fiatAmount ,
1105
+ sourceAmount : new CryptoAmount ( {
1106
+ currencyConfig : coreWallet . currencyConfig ,
1107
+ tokenId,
1108
+ nativeAmount
1109
+ } ) ,
1102
1110
fiatProviderId : pluginId ,
1103
1111
orderId : id
1104
1112
}
1105
1113
} )
1106
1114
1107
1115
// 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 ( {
1112
1118
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
+ } )
1117
1123
}
1118
1124
}
1119
1125
@@ -1123,7 +1129,7 @@ const completeSellOrder = async (
1123
1129
*/
1124
1130
const completeBuyOrder = async (
1125
1131
approveQuoteRes : BityApproveQuoteResponse ,
1126
- navigation : any
1132
+ navigation : NavigationBase
1127
1133
) : Promise < void > => {
1128
1134
const {
1129
1135
input,
@@ -1135,7 +1141,7 @@ const completeBuyOrder = async (
1135
1141
const { iban, swift_bic : swiftBic , recipient, reference } = paymentDetails
1136
1142
1137
1143
await new Promise < void > ( ( resolve , reject ) => {
1138
- navigation . navigate ( 'guiPluginSepaTransferInfo ' , {
1144
+ navigation . navigate ( 'guiPluginInfoDisplay ' , {
1139
1145
headerTitle : lstrings . payment_details ,
1140
1146
promptMessage : sprintf ( lstrings . sepa_transfer_prompt_s , id ) ,
1141
1147
transferInfo : {
0 commit comments