Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign Hot Wallet Import Screen #148

Merged
merged 13 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading