diff --git a/VERSION.properties b/VERSION.properties index 0bb807b..8aeaa9d 100644 --- a/VERSION.properties +++ b/VERSION.properties @@ -1,2 +1,2 @@ -client.version=1.2.238 -server.version=1.2.224 +client.version=1.2.240 +server.version=1.2.225 diff --git a/shine-UI/js/services/shine-user-pda-service.js b/shine-UI/js/services/shine-user-pda-service.js index bb70c4e..3ead3b8 100644 --- a/shine-UI/js/services/shine-user-pda-service.js +++ b/shine-UI/js/services/shine-user-pda-service.js @@ -653,6 +653,28 @@ function parseHex32(value) { return out; } +async function attachSolanaLogs(error, connection) { + if (!error || typeof error.getLogs !== 'function' || !connection) { + return error; + } + + try { + const logs = await error.getLogs(connection); + if (Array.isArray(logs) && logs.length) { + error.logs = logs; + error.transactionLogs = logs; + error.simulationLogs = logs; + if (!String(error.message || '').includes('Logs:')) { + error.message = `${String(error.message || 'Solana transaction failed')} :: Logs: ${logs.join(' | ')}`; + } + } + } catch { + // Если RPC не вернул логи, оставляем исходную ошибку как есть. + } + + return error; +} + async function buildCreateContext({ login, keyBundle, solanaEndpoint }) { const cleanLogin = normalizeLogin(login); const endpoint = String(solanaEndpoint || '').trim(); @@ -816,12 +838,17 @@ async function createShineUserPdaOnSolana({ data: ixData, }); - const signature = await ctx.solana.sendAndConfirmTransaction( - ctx.connection, - new ctx.solana.Transaction().add(ed25519RootIx, ed25519BchIx, createIx), - [ctx.clientKeypair], - { commitment: 'confirmed' }, - ); + let signature; + try { + signature = await ctx.solana.sendAndConfirmTransaction( + ctx.connection, + new ctx.solana.Transaction().add(ed25519RootIx, ed25519BchIx, createIx), + [ctx.clientKeypair], + { commitment: 'confirmed' }, + ); + } catch (error) { + throw await attachSolanaLogs(error, ctx.connection); + } return { signature, @@ -1030,12 +1057,17 @@ export async function updateShineUserPdaOnSolana({ const computeIx = solana.ComputeBudgetProgram.setComputeUnitLimit({ units: 800_000 }); const heapIx = solana.ComputeBudgetProgram.requestHeapFrame({ bytes: 262_144 }); - const signature = await solana.sendAndConfirmTransaction( - connection, - new solana.Transaction().add(computeIx, heapIx, edIxRoot, edIxBch, updateIx), - [clientKeypair], - { commitment: 'confirmed' }, - ); + let signature; + try { + signature = await solana.sendAndConfirmTransaction( + connection, + new solana.Transaction().add(computeIx, heapIx, edIxRoot, edIxBch, updateIx), + [clientKeypair], + { commitment: 'confirmed' }, + ); + } catch (error) { + throw await attachSolanaLogs(error, connection); + } return { signature, diff --git a/shine-UI/server-ui/create-server-pda.html b/shine-UI/server-ui/create-server-pda.html index 99e2248..2911b2e 100644 --- a/shine-UI/server-ui/create-server-pda.html +++ b/shine-UI/server-ui/create-server-pda.html @@ -61,7 +61,7 @@
- +
@@ -97,6 +97,11 @@
Ключевые пары (base58)
+
+
Recovery Key — восстановление аккаунта
+
Публичный
+
Приватный
+
Root Key — подпись PDA-записи
Публичный
diff --git a/shine-UI/server-ui/js/create-server-pda-page.js b/shine-UI/server-ui/js/create-server-pda-page.js index e1a61b6..6e05cce 100644 --- a/shine-UI/server-ui/js/create-server-pda-page.js +++ b/shine-UI/server-ui/js/create-server-pda-page.js @@ -19,6 +19,8 @@ import { const fieldMap = { masterSecret: 'masterSecret', + recoveryPub: 'recoveryPub', + recoveryPriv: 'recoveryPriv', rootPub: 'rootPub', rootPriv: 'rootPriv', bchPub: 'bchPub', diff --git a/shine-UI/server-ui/js/update-server-pda-page.js b/shine-UI/server-ui/js/update-server-pda-page.js index 0f8b477..bf46ab7 100644 --- a/shine-UI/server-ui/js/update-server-pda-page.js +++ b/shine-UI/server-ui/js/update-server-pda-page.js @@ -25,6 +25,8 @@ import { const fieldMap = { masterSecret: 'masterSecret', + recoveryPub: 'recoveryPub', + recoveryPriv: 'recoveryPriv', rootPub: 'rootPub', rootPriv: 'rootPriv', bchPub: 'bchPub', @@ -39,6 +41,7 @@ let currentPda = null; function resetExpectedKeysUi() { $('expectedKeysBox').style.display = 'none'; + setText('expectedRecoveryPub', ''); setText('expectedRootPub', ''); setText('expectedBchPub', ''); setText('expectedDevPub', ''); @@ -48,6 +51,7 @@ 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)); @@ -59,6 +63,7 @@ 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) diff --git a/shine-UI/server-ui/update-server-pda.html b/shine-UI/server-ui/update-server-pda.html index e21a7e3..15b3c0b 100644 --- a/shine-UI/server-ui/update-server-pda.html +++ b/shine-UI/server-ui/update-server-pda.html @@ -86,7 +86,7 @@

Новые параметры сервера

- +
@@ -118,6 +118,11 @@
Ключевые пары (base58)
+
+
Recovery Key — восстановление аккаунта
+
Публичный
+
Приватный
+
Root Key — подпись PDA-записи
Публичный
@@ -143,7 +148,11 @@