Skip to content

Commit

Permalink
Merge pull request #148 from bitcoinppl/138-redesign-screen-import-wa…
Browse files Browse the repository at this point in the history
…llet-screen

Redesign Hot Wallet Import Screen
  • Loading branch information
praveenperera authored Jan 8, 2025
2 parents 3a4894a + 3161775 commit caa4c9a
Show file tree
Hide file tree
Showing 15 changed files with 705 additions and 430 deletions.
34 changes: 34 additions & 0 deletions ios/Cove/Cove.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,11 @@ public protocol Bip39AutoCompleteProtocol : AnyObject {

func isValidWord(word: String) -> Bool

/**
* Find the next invalid or empty field number
*/
func nextFieldNumber(currentFieldNumber: UInt8, enteredWords: [String]) -> UInt8

}

open class Bip39AutoComplete:
Expand Down Expand Up @@ -1921,6 +1926,18 @@ open func isValidWord(word: String) -> Bool {
})
}

/**
* Find the next invalid or empty field number
*/
open func nextFieldNumber(currentFieldNumber: UInt8, enteredWords: [String]) -> UInt8 {
return try! FfiConverterUInt8.lift(try! rustCall() {
uniffi_cove_fn_method_bip39autocomplete_next_field_number(self.uniffiClonePointer(),
FfiConverterUInt8.lower(currentFieldNumber),
FfiConverterSequenceString.lower(enteredWords),$0
)
})
}


}

Expand Down Expand Up @@ -1986,6 +2003,8 @@ public protocol Bip39WordSpecificAutocompleteProtocol : AnyObject {

func isValidWord(word: String, allWords: [[String]]) -> Bool

func nextFieldNumber(currentFieldNumber: UInt8, enteredWords: [String]) -> UInt8

}

open class Bip39WordSpecificAutocomplete:
Expand Down Expand Up @@ -2073,6 +2092,15 @@ open func isValidWord(word: String, allWords: [[String]]) -> Bool {
})
}

open func nextFieldNumber(currentFieldNumber: UInt8, enteredWords: [String]) -> UInt8 {
return try! FfiConverterUInt8.lift(try! rustCall() {
uniffi_cove_fn_method_bip39wordspecificautocomplete_next_field_number(self.uniffiClonePointer(),
FfiConverterUInt8.lower(currentFieldNumber),
FfiConverterSequenceString.lower(enteredWords),$0
)
})
}


}

Expand Down Expand Up @@ -22352,6 +22380,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_cove_checksum_method_bip39autocomplete_is_valid_word() != 19081) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_cove_checksum_method_bip39autocomplete_next_field_number() != 24967) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_cove_checksum_method_bip39wordspecificautocomplete_autocomplete() != 34680) {
return InitializationResult.apiChecksumMismatch
}
Expand All @@ -22361,6 +22392,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_cove_checksum_method_bip39wordspecificautocomplete_is_valid_word() != 4400) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_cove_checksum_method_bip39wordspecificautocomplete_next_field_number() != 39232) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_cove_checksum_method_bitcointransaction_normalize_tx_id() != 15620) {
return InitializationResult.apiChecksumMismatch
}
Expand Down
7 changes: 7 additions & 0 deletions ios/Cove/Extention/String+Ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ extension String {
func addressSpacedOut() -> String {
addressStringSpacedOut(address: self)
}

func padLeft(with: String, toLength: Int) -> String {
if count >= toLength { return self }

let padding = String(repeating: with, count: toLength - count)
return padding + self
}
}

extension String? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct WordsView: View {
"Your secret recovery words are the only way to recover your wallet if you lose your phone or switch to a different wallet. Whoever, has you recovery words, controls your Bitcoin."
)
.font(.subheadline)
.foregroundStyle(.lightGray)
.foregroundStyle(.coveLightGray)
.multilineTextAlignment(.leading)
.opacity(0.70)
.fixedSize(horizontal: false, vertical: true)
Expand All @@ -86,7 +86,7 @@ struct WordsView: View {
}

Divider()
.overlay(.lightGray.opacity(0.50))
.overlay(.coveLightGray.opacity(0.50))

VStack(spacing: 24) {
Group {
Expand Down
Loading

0 comments on commit caa4c9a

Please sign in to comment.