Refactor wallet recovery logic
This commit is contained in:
parent
4f27833ec0
commit
bb30be548a
@ -2921,14 +2921,10 @@
|
||||
|
||||
try {
|
||||
let wallet;
|
||||
if (typeof tonCrypto !== "undefined" && tonCrypto.recoverFromInput) {
|
||||
if (typeof tonCrypto !== "undefined" ) {
|
||||
wallet = await tonCrypto.recoverFromInput(privateKeyInput);
|
||||
} else {
|
||||
// Fallback to getSenderWallet with the provided key
|
||||
wallet = await tonBlockchainAPI.getSenderWallet(privateKeyInput);
|
||||
}
|
||||
const tonData = wallet.TON || wallet;
|
||||
// Pre-convert the TON address to avoid Promise display
|
||||
const friendlyTonAddress = await convertTob64(tonData.address);
|
||||
|
||||
output.innerHTML = `
|
||||
@ -3049,7 +3045,6 @@
|
||||
</div>
|
||||
<div class="error-message">
|
||||
<h3>Recovery Failed</h3>
|
||||
<p>Failed to recover : ${error.message}</p>
|
||||
<p>Please check that you've entered a valid private key in the correct format.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user