SHA256
Новый протокол Solana PDA 1.2
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
||||
formatBigInt,
|
||||
formatTimestamp,
|
||||
openDevnetTopup,
|
||||
parseLoginList,
|
||||
publicKeyBytesToBase58,
|
||||
refreshDeviceBalance,
|
||||
setGenMessage,
|
||||
@@ -26,8 +25,6 @@ import { defaultServerAddress, defaultServerLogin, defaultSolanaEndpoint } from
|
||||
|
||||
const fieldMap = {
|
||||
masterSecret: 'masterSecret',
|
||||
recoveryPub: 'recoveryPub',
|
||||
recoveryPriv: 'recoveryPriv',
|
||||
rootPub: 'rootPub',
|
||||
rootPriv: 'rootPriv',
|
||||
bchPub: 'bchPub',
|
||||
@@ -42,7 +39,6 @@ let currentPda = null;
|
||||
|
||||
function resetExpectedKeysUi() {
|
||||
$('expectedKeysBox').style.display = 'none';
|
||||
setText('expectedRecoveryPub', '');
|
||||
setText('expectedRootPub', '');
|
||||
setText('expectedBchPub', '');
|
||||
setText('expectedDevPub', '');
|
||||
@@ -52,7 +48,6 @@ function resetExpectedKeysUi() {
|
||||
|
||||
function renderExpectedKeys(parsed) {
|
||||
$('expectedKeysBox').style.display = 'block';
|
||||
setText('expectedRecoveryPub', publicKeyBytesToBase58(parsed.recoveryKey));
|
||||
setText('expectedRootPub', publicKeyBytesToBase58(parsed.rootKey));
|
||||
setText('expectedBchPub', publicKeyBytesToBase58(parsed.blockchain.blockchainPublicKey));
|
||||
setText('expectedDevPub', publicKeyBytesToBase58(parsed.clientKey));
|
||||
@@ -64,7 +59,6 @@ function compareCurrentFormKeysWithPda() {
|
||||
const blockchainActual = String($('bchPub').value || '').trim();
|
||||
return {
|
||||
resultMap: {
|
||||
recovery: compareExpectedPublicKeys(publicKeyBytesToBase58(currentPda.recoveryKey), $('recoveryPub').value),
|
||||
root: compareExpectedPublicKeys(publicKeyBytesToBase58(currentPda.rootKey), $('rootPub').value),
|
||||
blockchain: blockchainActual
|
||||
? compareExpectedPublicKeys(publicKeyBytesToBase58(currentPda.blockchain.blockchainPublicKey), blockchainActual)
|
||||
@@ -178,17 +172,15 @@ $('btnLoad').addEventListener('click', async () => {
|
||||
$('iCreated').textContent = formatTimestamp(parsed.createdAtMs);
|
||||
$('iUpdated').textContent = formatTimestamp(parsed.updatedAtMs);
|
||||
$('iSrvAddr').textContent = parsed.serverAddress || '—';
|
||||
$('iSync').textContent = parsed.syncServers.length ? parsed.syncServers.join(', ') : '—';
|
||||
$('iBch').textContent = parsed.blockchain.blockchainName;
|
||||
$('iLimit').textContent = formatBigInt(parsed.blockchain.paidLimitBytes);
|
||||
|
||||
$('password').value = '';
|
||||
$('serverAddress').value = parsed.serverAddress || '';
|
||||
$('syncServers').value = parsed.syncServers.join('\n');
|
||||
$('pdaInfo').style.display = 'block';
|
||||
$('updateForm').style.display = 'block';
|
||||
renderExpectedKeys(parsed);
|
||||
setStatus($('status'), 'PDA загружена. Можно менять адрес или sync_servers.', 'success');
|
||||
setStatus($('status'), 'PDA загружена. Можно менять адрес сервера.', 'success');
|
||||
} catch (error) {
|
||||
setStatus($('status'), error?.message || String(error), 'error');
|
||||
} finally {
|
||||
@@ -227,7 +219,6 @@ $('btnUpdate').addEventListener('click', async () => {
|
||||
serverAddress,
|
||||
addressFormatType: currentPda.addressFormatType ?? 1,
|
||||
addressFormatVersion: currentPda.addressFormatVersion ?? 0,
|
||||
syncServers: parseLoginList($('syncServers').value),
|
||||
solanaEndpoint: endpoint,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user