@@ -3,7 +3,6 @@ package to.bitkit.repositories
33import com.synonym.bitkitcore.AddressType
44import com.synonym.bitkitcore.PreActivityMetadata
55import com.synonym.bitkitcore.Scanner
6- import com.synonym.bitkitcore.decode
76import kotlinx.coroutines.CoroutineDispatcher
87import kotlinx.coroutines.CoroutineScope
98import kotlinx.coroutines.Job
@@ -137,7 +136,7 @@ class WalletRepo @Inject constructor(
137136 ) {
138137 val onChainAddress = getOnchainAddress()
139138 val paymentHash = runCatching {
140- when (val decoded = decode(bip21Url)) {
139+ when (val decoded = coreService. decode(bip21Url)) {
141140 is Scanner .Lightning -> decoded.invoice.paymentHash.toHex()
142141 is Scanner .OnChain -> decoded.extractLightningHash()
143142 else -> null
@@ -418,7 +417,7 @@ class WalletRepo @Inject constructor(
418417 if (bolt11.isEmpty()) return @withContext null
419418
420419 runCatching {
421- when (val decoded = decode(bolt11)) {
420+ when (val decoded = coreService. decode(bolt11)) {
422421 is Scanner .Lightning -> decoded.invoice.paymentHash.toHex()
423422 else -> null
424423 }
@@ -544,7 +543,7 @@ class WalletRepo @Inject constructor(
544543 private suspend fun Scanner.OnChain.extractLightningHash (): String? {
545544 val lightningInvoice: String = this .invoice.params?.get(" lightning" ) ? : return null
546545
547- return when (val decoded = decode(lightningInvoice)) {
546+ return when (val decoded = coreService. decode(lightningInvoice)) {
548547 is Scanner .Lightning -> decoded.invoice.paymentHash.toHex()
549548 else -> null
550549 }
0 commit comments