Skip to content

Commit

Permalink
Fix the issue with creating TonKit
Browse files Browse the repository at this point in the history
Issue is reproducible for only some accounts
  • Loading branch information
abdrasulov committed Dec 28, 2023
1 parent d581577 commit ac88f82
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ class TonAdapter(
is AccountType.Mnemonic -> {
val hdWallet = HDWallet(accountType.seed, 607, HDWallet.Purpose.BIP44, Curve.Ed25519)
val privateKey = hdWallet.privateKey(0)
tonKitFactory.create(privateKey.privKeyBytes, wallet.account.id)
var privateKeyBytes = privateKey.privKeyBytes
if (privateKeyBytes.size > 32) {
privateKeyBytes = privateKeyBytes.copyOfRange(1, privateKeyBytes.size)
}
tonKitFactory.create(privateKeyBytes, wallet.account.id)
}

is AccountType.TonAddress -> {
Expand Down

0 comments on commit ac88f82

Please sign in to comment.