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 @@