-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Batch 8:
DeviceFactorSource
+ `PrivateHierarchicalDeterministicFact…
…orSource` and some `BIP39*` types. (#97)
- Loading branch information
1 parent
5ccf175
commit d6e3c90
Showing
100 changed files
with
1,765 additions
and
308 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...rces/Sargon/Extensions/Methods/Crypto/Derivation/BIP39/BIP39Language+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension BIP39Language { | ||
public func wordlist() -> [BIP39Word] { | ||
bip39LanguageWordlist(language: self) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ces/Sargon/Extensions/Methods/Crypto/Derivation/BIP39/BIP39WordCount+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension BIP39WordCount { | ||
public static var allCases: [Self] { | ||
bip39WordCountAll() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apple/Sources/Sargon/Extensions/Methods/Crypto/Keys/PrivateHD+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension PrivateHierarchicalDeterministicFactorSource { | ||
|
||
public static func olympia( | ||
mnemonicWithPassphrase: MnemonicWithPassphrase | ||
) -> Self { | ||
newPrivateHdFactorSourceOlympiaFromMnemonicWithPassphrase( | ||
mnemonicWithPassphrase: mnemonicWithPassphrase, | ||
walletClientModel: .iphone | ||
) | ||
} | ||
|
||
public static func babylon( | ||
isMainBDFS: Bool, | ||
mnemonicWithPassphrase: MnemonicWithPassphrase | ||
) -> Self { | ||
newPrivateHdFactorSourceBabylonFromMnemonicWithPassphrase( | ||
isMain: isMainBDFS, | ||
mnemonicWithPassphrase: mnemonicWithPassphrase, | ||
walletClientModel: .iphone | ||
) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
apple/Sources/Sargon/Extensions/Methods/Profile/AppPreferences+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension AppPreferences { | ||
public static let `default`: Self = newAppPreferencesDefault() | ||
} |
37 changes: 37 additions & 0 deletions
37
.../Sources/Sargon/Extensions/Methods/Profile/Factor/DeviceFactorSource+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension DeviceFactorSource { | ||
|
||
public static func olympia( | ||
mnemonicWithPassphrase: MnemonicWithPassphrase | ||
) -> Self { | ||
newDeviceFactorSourceOlympia( | ||
mnemonicWithPassphrase: mnemonicWithPassphrase, | ||
walletClientModel: .iphone | ||
) | ||
} | ||
|
||
public static func babylon( | ||
mnemonicWithPassphrase: MnemonicWithPassphrase, | ||
isMain: Bool | ||
) -> Self { | ||
newDeviceFactorSourceBabylon( | ||
isMain: isMain, | ||
mnemonicWithPassphrase: mnemonicWithPassphrase, | ||
walletClientModel: .iphone | ||
) | ||
} | ||
|
||
|
||
public var isMainBDFS: Bool { | ||
deviceFactorSourceIsMainBdfs(deviceFactorSource: self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
apple/Sources/Sargon/Extensions/Methods/Profile/Factor/FactorSourceKind+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension FactorSourceKind { | ||
|
||
public init(string: String) throws { | ||
self = try newFactorSourceKindFromString(string: string) | ||
} | ||
|
||
public func toString() -> String { | ||
factorSourceKindToString(kind: self) | ||
} | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
...s/Sargon/Extensions/Methods/Profile/Factor/LedgerHardwareWalletModel+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension LedgerHardwareWalletModel { | ||
public init(string: String) throws { | ||
self = try newLedgerHwWalletModelFromString(string: string) | ||
} | ||
|
||
public func toString() -> String { | ||
ledgerHwWalletModelToString(model: self) | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/Sargon/Extensions/SampleValues/Crypto/Derivation/BIP39/BIP39Language+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension BIP39Language { | ||
public static let sample: Self = newBip39LanguageSample() | ||
public static let sampleOther: Self = newBip39LanguageSampleOther() | ||
} | ||
#endif // DEBUG |
10 changes: 10 additions & 0 deletions
10
...ources/Sargon/Extensions/SampleValues/Crypto/Derivation/BIP39/Mnemonic+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension Mnemonic { | ||
public static let sample: Self = newMnemonicSample() | ||
public static let sampleOther: Self = newMnemonicSampleOther() | ||
|
||
public static let sample24ZooVote: Self = try! Self(phrase: "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote") | ||
} | ||
#endif // DEBUG |
File renamed without changes.
13 changes: 0 additions & 13 deletions
13
apple/Sources/Sargon/Extensions/SampleValues/Crypto/Derivation/Mnemonic+SampleValues.swift
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
apple/Sources/Sargon/Extensions/SampleValues/Profile/AppPreferences+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-19. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension AppPreferences { | ||
public static let sample: Self = newAppPreferencesSample() | ||
public static let sampleOther: Self = newAppPreferencesSampleOther() | ||
} | ||
#endif // DEBUG |
16 changes: 16 additions & 0 deletions
16
...n/Extensions/SampleValues/Profile/Factor/FactorSource/FactorSourceKind+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension FactorSourceKind { | ||
public static let sample: Self = newFactorSourceKindSample() | ||
public static let sampleOther: Self = newFactorSourceKindSampleOther() | ||
} | ||
#endif // DEBUG |
8 changes: 8 additions & 0 deletions
8
...ofile/Factor/FactorSource/PrivateHierarchicalDeterministicFactorSource+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension PrivateHierarchicalDeterministicFactorSource { | ||
public static let sample: Self = newPrivateHdFactorSourceSample() | ||
public static let sampleOther: Self = newPrivateHdFactorSourceSampleOther() | ||
} | ||
#endif // DEBUG |
16 changes: 16 additions & 0 deletions
16
...urces/Sargon/Extensions/SampleValues/Profile/LedgerHardwareWalletModel+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension LedgerHardwareWalletModel { | ||
public static let sample: Self = newLedgerHwWalletModelSample() | ||
public static let sampleOther: Self = newLedgerHwWalletModelSampleOther() | ||
} | ||
#endif // DEBUG |
12 changes: 12 additions & 0 deletions
12
...urces/Sargon/Extensions/Swiftified/Crypto/Derivation/BIP39/BIP39Language+Swiftified.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-22. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
public typealias BIP39Language = Bip39Language | ||
extension BIP39Language: SargonModel {} |
Oops, something went wrong.