Repository navigation
Commit a77defb
committed
refactor(sdk): run the KeyWallet helpers on platform-wallet-ffi
`TransactionDecoder.decode`, `Mnemonic.generate`, `Mnemonic.validate`, `KeyDerivation.getIdentityAuthenticationPath` and `Address.validate` keep their Swift signatures and now call `platform-wallet-ffi`. The Kotlin JNI `decodeTransaction` and `generateMnemonic` bridges do the same and map failures through `take_pwffi_error`, so `rs-unified-sdk-jni` no longer depends on `key-wallet-ffi`.
`platform_wallet_mnemonic_word_list` takes its language as a plain integer too, and the Swift callers pass `MnemonicLanguage.rawValue`. The JNI bridge passes Kotlin's ordinal through unchanged, so an unknown ordinal is an error instead of English, and Kotlin's `Language` gains Japanese, Korean, Portuguese and Spanish.
New Swift API lets apps stop rebuilding a `KeyWallet` wallet from the phrase: `Mnemonic.walletId(for:network:)`, `Mnemonic.firstReceiveAddress(for:network:)`, and `ManagedPlatformWallet.findBIP44AddressPath(address:)` and `bip44AddressPrivateKey(address:storage:)` for the BIP-44 account scan. The last shares `coreAddressPrivateKey`'s resolver handling. Every helper that passes a string to C rejects an embedded NUL. Parity tests pin the wallet id and the first receive address against the `KeyWallet` code they replace, for English and French phrases.
`Mnemonic.generate`, `TransactionDecoder.decode` and `getIdentityAuthenticationPath` now throw `PlatformWalletError`. The other `KeyWallet` classes and `rs-unified-sdk-ffi`'s `key-wallet-ffi` dependency are unchanged.1 parent 19718b0 commit a77defb
25 files changed
Lines changed: 338 additions & 245 deletions
File tree
- packages
- kotlin-sdk
- sdk/src
- main/kotlin/org/dashfoundation/dashsdk
- ffi
- keywallet
- persistence
- test/kotlin/org/dashfoundation/dashsdk/persistence
- rs-platform-wallet-ffi/src
- rs-unified-sdk-jni
- src
- swift-sdk
- Sources/SwiftDashSDK
- KeyWallet
- PlatformWallet
- SwiftTests/SwiftDashSDKTests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
| 166 | + | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
| 137 | + | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
4265 | 4265 | | |
4266 | 4266 | | |
4267 | 4267 | | |
4268 | | - | |
4269 | | - | |
| 4268 | + | |
| 4269 | + | |
4270 | 4270 | | |
4271 | 4271 | | |
4272 | 4272 | | |
| |||
0 commit comments