Skip to content

Commit eb78bb6

Browse files
committed
feat: update BIP21
1 parent d542b23 commit eb78bb6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import to.bitkit.services.LdkNodeEventBus
4343
import to.bitkit.services.LightningService
4444
import to.bitkit.ui.shared.toast.ToastEventBus
4545
import to.bitkit.utils.AddressChecker
46+
import to.bitkit.utils.Bip21Utils
4647
import to.bitkit.utils.Logger
4748
import javax.inject.Inject
4849

@@ -338,9 +339,16 @@ class WalletViewModel @Inject constructor(
338339
) {
339340
viewModelScope.launch(Dispatchers.IO) {
340341
_bolt11 = createInvoice(amountSats = amountSats, description= description)
341-
}
342+
val newBip21 = Bip21Utils.buildBip21Url(
343+
bitcoinAddress = lightningService.newAddress(),
344+
amountSats = amountSats,
345+
message = description.ifBlank { "Bitkit" },
346+
lightningInvoice = _bolt11
347+
)
348+
_bip21 = newBip21
342349

343-
//TODO UPDATE BIP21
350+
syncState()
351+
}
344352
}
345353

346354

0 commit comments

Comments
 (0)