SHA256
UI: уточнить шаг пополнения регистрации
This commit is contained in:
+2
-2
@@ -1,2 +1,2 @@
|
||||
client.version=1.2.345
|
||||
server.version=1.2.317
|
||||
client.version=1.2.346
|
||||
server.version=1.2.318
|
||||
|
||||
@@ -6,4 +6,4 @@ export const defaultServerAddress = 'shineup.me';
|
||||
export const defaultServerHttp = `https://${defaultServerAddress}`;
|
||||
export const defaultServerWs = `wss://${defaultServerAddress}/ws`;
|
||||
export const defaultSolanaCluster = 'mainnet-beta';
|
||||
export const defaultSolanaEndpoint = 'https://solana-rpc.publicnode.com';
|
||||
export const defaultSolanaEndpoint = 'https://public.rpc.solanavibestation.com/';
|
||||
|
||||
@@ -25,6 +25,7 @@ import { defaultServerLogin } from '../deploy-config.js';
|
||||
|
||||
export const pageMeta = { id: 'registration-payment-view', title: 'Оплата регистрации', showAppChrome: false };
|
||||
const MIN_REQUIRED_SOL = 0.01;
|
||||
const RECOMMENDED_TOPUP_SOL = 0.02;
|
||||
const AUTO_LOGIN_INITIAL_DELAY_MS = 1000;
|
||||
const AUTO_LOGIN_RETRY_MS = 2000;
|
||||
const REGISTRATION_PROGRESS_DURATION_MS = 12000;
|
||||
@@ -42,6 +43,20 @@ function getExplorerClusterName(endpoint) {
|
||||
return 'mainnet-beta';
|
||||
}
|
||||
|
||||
function isTestRegistrationContour() {
|
||||
const solanaCluster = getExplorerClusterName(state.entrySettings.solanaServer);
|
||||
if (solanaCluster !== 'mainnet-beta') return true;
|
||||
const shineServer = String(state.entrySettings.shineServer || '').trim().toLowerCase();
|
||||
const shineServerLogin = String(state.entrySettings.shineServerLogin || '').trim().toLowerCase();
|
||||
return (
|
||||
shineServer.includes('t1.shineup.me')
|
||||
|| shineServer.includes('t2.shineup.me')
|
||||
|| shineServer.includes('t3.shineup.me')
|
||||
|| shineServer.includes('t4.shineup.me')
|
||||
|| ['t1', 't2', 't3', 't4'].includes(shineServerLogin)
|
||||
);
|
||||
}
|
||||
|
||||
function makeSolanaExplorerTxUrl(signature, endpoint) {
|
||||
const cleanSignature = String(signature || '').trim();
|
||||
if (!cleanSignature) return '';
|
||||
@@ -152,14 +167,16 @@ export function render({ navigate }) {
|
||||
walletValue.type = 'text';
|
||||
walletValue.value = state.registrationPayment.walletAddress || '';
|
||||
walletValue.readOnly = true;
|
||||
walletValue.style.width = '100%';
|
||||
|
||||
const walletRow = document.createElement('div');
|
||||
walletRow.className = 'inline-input-row';
|
||||
walletRow.className = 'stack';
|
||||
|
||||
const copyButton = document.createElement('button');
|
||||
copyButton.className = 'ghost-btn';
|
||||
copyButton.type = 'button';
|
||||
copyButton.textContent = 'Скопировать номер';
|
||||
copyButton.style.width = '100%';
|
||||
copyButton.addEventListener('click', async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(walletValue.value);
|
||||
@@ -232,6 +249,7 @@ export function render({ navigate }) {
|
||||
|
||||
balanceRow.append(balanceValue, refreshButton);
|
||||
|
||||
const isTestContour = isTestRegistrationContour();
|
||||
const topupButton = document.createElement('button');
|
||||
topupButton.className = 'ghost-btn';
|
||||
topupButton.type = 'button';
|
||||
@@ -277,11 +295,15 @@ export function render({ navigate }) {
|
||||
if (currentBalance == null) return;
|
||||
if (currentBalance < MIN_REQUIRED_SOL) {
|
||||
status.className = 'status-line is-unavailable';
|
||||
status.textContent = `Для регистрации нужно минимум ${MIN_REQUIRED_SOL} SOL. Сейчас на кошельке ${formatSol(currentBalance, 6)} SOL. Пополните на промо-странице или попросите перевод у знакомого с тестовыми SOL.`;
|
||||
status.textContent = isTestContour
|
||||
? `Для регистрации нужно минимум ${MIN_REQUIRED_SOL} SOL. Рекомендуем пополнить кошелёк примерно на ${RECOMMENDED_TOPUP_SOL} SOL. Сейчас на кошельке ${formatSol(currentBalance, 6)} SOL.`
|
||||
: `Для регистрации пополните этот кошелёк соланами примерно на ${RECOMMENDED_TOPUP_SOL} SOL. Сейчас на кошельке ${formatSol(currentBalance, 6)} SOL. Минимум для продолжения: ${MIN_REQUIRED_SOL} SOL.`;
|
||||
status.style.display = '';
|
||||
const openTopup = window.confirm('Открыть страницу пополнения с вашим кошельком?');
|
||||
if (openTopup) {
|
||||
window.open(getTopupSiteUrl(walletAddress), '_blank', 'noopener,noreferrer');
|
||||
if (isTestContour) {
|
||||
const openTopup = window.confirm('Открыть страницу пополнения с вашим кошельком?');
|
||||
if (openTopup) {
|
||||
window.open(getTopupSiteUrl(walletAddress), '_blank', 'noopener,noreferrer');
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -323,15 +345,18 @@ export function render({ navigate }) {
|
||||
});
|
||||
|
||||
card.innerHTML = `
|
||||
<p class="auth-copy">Для регистрации в тестовой Solana нужно минимум 0,01 SOL на вашем кошельке.</p>
|
||||
<label class="stack"><span class="field-label">Номер кошелька (client.key)</span></label>
|
||||
<p class="auth-copy">Для регистрации пополните этот кошелёк соланами примерно на ${RECOMMENDED_TOPUP_SOL} SOL.</p>
|
||||
<label class="stack"><span class="field-label">Номер кошелька</span></label>
|
||||
<div class="stack">
|
||||
<span class="field-label">Баланс (Solana)</span>
|
||||
</div>
|
||||
`;
|
||||
card.children[1].append(walletRow);
|
||||
card.children[2].append(balanceRow);
|
||||
card.append(topupButton, showKeysButton, submitButton, status);
|
||||
if (isTestContour) {
|
||||
card.append(topupButton);
|
||||
}
|
||||
card.append(showKeysButton, submitButton, status);
|
||||
|
||||
screen.append(
|
||||
renderHeader({
|
||||
|
||||
Reference in New Issue
Block a user