SHA256
Добавить систему поддержки SHiNE
This commit is contained in:
@@ -9,10 +9,15 @@ import {
|
||||
getSolanaWalletFromStoredSecret,
|
||||
getWalletFromStoredBlockchainKey,
|
||||
solanaAddressFromPublicKeyBase64,
|
||||
transferSol,
|
||||
} from '../services/solana-wallet-service.js';
|
||||
import { showToast } from '../services/channels-ux.js';
|
||||
import { toUserMessage } from '../services/ui-error-texts.js';
|
||||
import { bytesToBase58 } from '../services/crypto-utils.js';
|
||||
import { loadEncryptedUserSecrets } from '../services/key-vault.js';
|
||||
import { readShineUserPda, supportShineUserOnSolana } from '../services/shine-user-pda-service.js';
|
||||
import { parseSolLamports, formatLamportsSol, hexHash32 } from '../services/shine-support-amount.js';
|
||||
import { transferSolLamports } from '../services/solana-wallet-service.js';
|
||||
import { loadVerifiedSupportTotals, formatVerifiedSupportLamports } from '../services/support-totals-service.js';
|
||||
|
||||
export const pageMeta = { id: 'channel-donate-view', get title() { return t('screens.channel_donate_view.text_001'); } };
|
||||
|
||||
@@ -135,12 +140,14 @@ export function render({ navigate, route, chrome }) {
|
||||
walletCache.clear();
|
||||
};
|
||||
|
||||
const renderDonationForm = ({ channel, selector, ownerUser }) => {
|
||||
const renderDonationForm = ({ channel, selector, ownerUser, recipientPda }) => {
|
||||
const ownerLogin = String(channel?.ownerLogin || extractLoginFromBlockchainName(selector?.ownerBlockchainName) || '').trim();
|
||||
const channelTitle = String(channel?.displayTitle || channel?.displayName || channel?.channelName || t('screens.channel_donate_view.text_018')).trim();
|
||||
const channelName = String(channel?.channelName || selector?.channelName || '').trim();
|
||||
const recipientChoices = [
|
||||
publicKeyChoice(ownerUser, 'blockchainKey', 'blockchain-key', 'Blockchain key'),
|
||||
recipientPda?.forks?.length
|
||||
? { id: 'blockchain-key', label: 'Blockchain key', address: bytesToBase58(recipientPda.forks.at(-1).blockchainKey) }
|
||||
: publicKeyChoice(ownerUser, 'blockchainKey', 'blockchain-key', 'Blockchain key'),
|
||||
].filter(Boolean);
|
||||
|
||||
content.innerHTML = `
|
||||
@@ -149,6 +156,7 @@ export function render({ navigate, route, chrome }) {
|
||||
<strong>${escapeHtml(channelTitle)}</strong>
|
||||
<span>${escapeHtml(formatChannelAddress({ ownerLogin, channelName }))}</span>
|
||||
</div>
|
||||
<div class="meta-muted" id="channel-donate-verified-total"></div>
|
||||
|
||||
<section class="channel-donate-section">
|
||||
<label class="field-label" for="channel-donate-blockchain">${th('screens.channel_donate_view.text_024')}</label>
|
||||
@@ -180,14 +188,17 @@ export function render({ navigate, route, chrome }) {
|
||||
<section class="channel-donate-section">
|
||||
<label class="field-label" for="channel-donate-amount">${th('screens.channel_donate_view.text_029')}</label>
|
||||
<div class="channel-donate-amount-row">
|
||||
<input class="input" id="channel-donate-amount" type="number" min="0" step="0.000001" inputmode="decimal" placeholder="0.1" />
|
||||
<input class="input" id="channel-donate-amount" type="text" inputmode="decimal" placeholder="0.1" autocomplete="off" />
|
||||
<span>SOL</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<p class="meta-muted" id="channel-donate-split"></p>
|
||||
<p class="meta-muted" id="channel-donate-explanation"></p>
|
||||
<p class="meta-muted inline-error channel-donate-status" id="channel-donate-status"></p>
|
||||
<div class="channel-donate-result" id="channel-donate-result" hidden></div>
|
||||
<button class="primary-btn channel-donate-submit" id="channel-donate-submit" type="button" ${recipientChoices.length ? '' : 'disabled'}>${th('screens.channel_donate_view.text_030')}</button>
|
||||
<button class="primary-btn channel-donate-submit" id="channel-donate-submit" type="button" ${recipientChoices.length && recipientPda ? '' : 'disabled'}>${th('screens.support_flow.donate')}</button>
|
||||
<button class="secondary-btn channel-donate-submit" id="channel-donate-direct" type="button" ${recipientChoices.length ? '' : 'disabled'}>${th('screens.support_flow.direct')}</button>
|
||||
`;
|
||||
|
||||
const recipientSelect = content.querySelector('#channel-donate-recipient-key');
|
||||
@@ -200,10 +211,14 @@ export function render({ navigate, route, chrome }) {
|
||||
const resultEl = content.querySelector('#channel-donate-result');
|
||||
const submitEl = content.querySelector('#channel-donate-submit');
|
||||
const refreshEl = content.querySelector('#channel-donate-refresh');
|
||||
const directEl = content.querySelector('#channel-donate-direct');
|
||||
const splitEl = content.querySelector('#channel-donate-split');
|
||||
const explanationEl = content.querySelector('#channel-donate-explanation');
|
||||
|
||||
const setBusy = (nextBusy) => {
|
||||
busy = Boolean(nextBusy);
|
||||
if (submitEl) submitEl.disabled = busy || recipientChoices.length === 0;
|
||||
if (submitEl) submitEl.disabled = busy || recipientChoices.length === 0 || !recipientPda;
|
||||
if (directEl) directEl.disabled = busy || recipientChoices.length === 0;
|
||||
if (refreshEl) refreshEl.disabled = busy;
|
||||
if (recipientSelect) recipientSelect.disabled = busy || recipientChoices.length === 0;
|
||||
if (senderSelect) senderSelect.disabled = busy;
|
||||
@@ -274,60 +289,83 @@ export function render({ navigate, route, chrome }) {
|
||||
});
|
||||
refreshEl?.addEventListener('click', () => void refreshBalance());
|
||||
|
||||
submitEl?.addEventListener('click', async () => {
|
||||
const renderSplit = () => {
|
||||
try {
|
||||
const amount = parseSolLamports(amountEl?.value || '');
|
||||
if (splitEl) splitEl.textContent = `${t('screens.support_flow.recipient')}: ${formatLamportsSol(amount * 9n / 10n)} SOL · ${t('screens.support_flow.fund')}: ${formatLamportsSol(amount / 10n)} SOL`;
|
||||
} catch { if (splitEl) splitEl.textContent = ''; }
|
||||
};
|
||||
if (explanationEl) explanationEl.textContent = recipientPda
|
||||
? t('screens.support_flow.explanation')
|
||||
: t('screens.support_flow.paid_required');
|
||||
amountEl?.addEventListener('input', renderSplit);
|
||||
|
||||
const submitTransfer = async (direct) => {
|
||||
if (busy || disposed) return;
|
||||
const recipient = selectedRecipient();
|
||||
if (!recipient?.address) {
|
||||
setStatus(t('screens.channel_donate_view.text_007'), 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
const amount = Number(String(amountEl?.value || '').replace(',', '.'));
|
||||
if (!Number.isFinite(amount) || amount <= 0) {
|
||||
setStatus(t('screens.channel_donate_view.text_008'), 'error');
|
||||
return;
|
||||
}
|
||||
if (!recipient?.address) { setStatus(t('screens.channel_donate_view.text_007'), 'error'); return; }
|
||||
let amount;
|
||||
try {
|
||||
amount = parseSolLamports(amountEl?.value || '');
|
||||
if (!direct && amount % 10n !== 0n) throw new Error(t('screens.support_flow.divisible'));
|
||||
} catch (error) { setStatus(error.message || t('screens.channel_donate_view.text_008'), 'error'); return; }
|
||||
if (direct && !window.confirm(t('screens.support_flow.direct_warning'))) return;
|
||||
|
||||
setBusy(true);
|
||||
setStatus(t('screens.channel_donate_view.text_009'));
|
||||
if (resultEl) {
|
||||
resultEl.hidden = true;
|
||||
resultEl.innerHTML = '';
|
||||
}
|
||||
|
||||
if (resultEl) { resultEl.hidden = true; resultEl.innerHTML = ''; }
|
||||
try {
|
||||
const wallet = await resolveSenderWallet();
|
||||
const result = await transferSol({
|
||||
endpoint: state.entrySettings.solanaServer,
|
||||
fromKeypair: wallet.keypair,
|
||||
toAddress: recipient.address,
|
||||
amountSol: amount,
|
||||
});
|
||||
let result;
|
||||
if (direct) {
|
||||
// Свежий ключ читается перед отправкой; если PDA есть, он приоритетнее серверного профиля.
|
||||
let address = recipient.address;
|
||||
if (recipientPda) {
|
||||
const fresh = await readShineUserPda({ login: ownerLogin, solanaEndpoint: state.entrySettings.solanaServer });
|
||||
const key = fresh.forks.at(-1).blockchainKey;
|
||||
address = bytesToBase58(key);
|
||||
} else {
|
||||
const latest = await authService.getUser(ownerLogin);
|
||||
address = publicKeyChoice(latest, 'blockchainKey', 'blockchain-key', 'Blockchain key')?.address || '';
|
||||
if (!address) throw new Error(t('screens.channel_donate_view.text_007'));
|
||||
}
|
||||
result = await transferSolLamports({ endpoint: state.entrySettings.solanaServer, fromKeypair: wallet.keypair, toAddress: address, amountLamports: amount });
|
||||
} else {
|
||||
if (!recipientPda) throw new Error(t('screens.support_flow.paid_required'));
|
||||
const { login, storagePwdInMemory: storagePwd } = state.session;
|
||||
const secrets = await loadEncryptedUserSecrets(login, storagePwd);
|
||||
if (!secrets?.blockchainKey || !secrets?.clientKey) throw new Error(t('screens.support_flow.keys_required'));
|
||||
result = await supportShineUserOnSolana({
|
||||
senderLogin: login, recipientLogin: ownerLogin, amountLamports: amount,
|
||||
target: { type: 1, channelBlockNumber: BigInt(selector.channelRootBlockNumber), channelBlockHash: hexHash32(selector.channelRootBlockHash) },
|
||||
solanaEndpoint: state.entrySettings.solanaServer,
|
||||
blockchainPrivatePkcs8B64: secrets.blockchainKey,
|
||||
clientPrivatePkcs8B64: secrets.clientKey,
|
||||
});
|
||||
}
|
||||
if (disposed) return;
|
||||
|
||||
setStatus('');
|
||||
if (resultEl) {
|
||||
resultEl.hidden = false;
|
||||
resultEl.innerHTML = `
|
||||
<strong>${th('screens.channel_donate_view.text_031')}</strong>
|
||||
<span>${escapeHtml(formatSol(amount))} SOL → ${escapeHtml(recipient.label)}</span>
|
||||
<code>${escapeHtml(String(result.signature || ''))}</code>
|
||||
`;
|
||||
resultEl.innerHTML = `<strong>${th('screens.channel_donate_view.text_031')}</strong><span>${escapeHtml(formatLamportsSol(amount))} SOL → ${escapeHtml(recipient.label)}</span><code>${escapeHtml(String(result.signature || ''))}</code>`;
|
||||
}
|
||||
showToast(t('screens.channel_donate_view.text_010'));
|
||||
|
||||
const balance = await getBalanceSol({
|
||||
endpoint: state.entrySettings.solanaServer,
|
||||
address: wallet.address,
|
||||
});
|
||||
const balance = await getBalanceSol({ endpoint: state.entrySettings.solanaServer, address: wallet.address });
|
||||
if (!disposed && balanceEl) balanceEl.textContent = `${formatSol(balance.sol)} SOL`;
|
||||
} catch (error) {
|
||||
if (!disposed) setStatus(toUserMessage(error, t('screens.channel_donate_view.text_011')), 'error');
|
||||
} finally {
|
||||
if (!disposed) setBusy(false);
|
||||
}
|
||||
});
|
||||
} finally { if (!disposed) setBusy(false); }
|
||||
};
|
||||
submitEl?.addEventListener('click', () => void submitTransfer(false));
|
||||
directEl?.addEventListener('click', () => void submitTransfer(true));
|
||||
renderSplit();
|
||||
|
||||
void loadVerifiedSupportTotals(selector).then((totals) => {
|
||||
if (disposed) return;
|
||||
const label = content.querySelector('#channel-donate-verified-total');
|
||||
const total = totals && formatVerifiedSupportLamports(totals.channelReceivedLamports);
|
||||
if (label && total) label.textContent = `${t('screens.support_phase3.channel_total')}: ${total}`;
|
||||
});
|
||||
updateRecipientAddress();
|
||||
if (!recipientChoices.length) {
|
||||
setStatus(t('screens.channel_donate_view.text_012'), 'error');
|
||||
@@ -351,7 +389,11 @@ export function render({ navigate, route, chrome }) {
|
||||
if (disposed || seq !== refreshSeq) return;
|
||||
if (!ownerUser?.exists) throw new Error(t('screens.channel_donate_view.text_022'));
|
||||
|
||||
renderDonationForm({ channel, selector, ownerUser });
|
||||
let recipientPda = null;
|
||||
try { recipientPda = await readShineUserPda({ login: ownerLogin, solanaEndpoint: state.entrySettings.solanaServer }); }
|
||||
catch { /* Free пользователь: доступен только прямой перевод. */ }
|
||||
if (disposed || seq !== refreshSeq) return;
|
||||
renderDonationForm({ channel, selector, ownerUser, recipientPda });
|
||||
} catch (error) {
|
||||
if (disposed || seq !== refreshSeq) return;
|
||||
content.innerHTML = `
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { openShineSupportDialog } from '../components/shine-support-dialog.js';
|
||||
import { hexHash32 } from '../services/shine-support-amount.js';
|
||||
import { formatDateTime } from '../i18n/format.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { appendShineMessageLinks } from '../services/shine-message-links.js';
|
||||
@@ -954,6 +956,14 @@ function renderNodeCard(node, heading, handlers, localNumber, { focusPost = fals
|
||||
});
|
||||
if (threadsLayout) actions.append(likeButton, ...(likes > 0 ? [likesStatsButton] : []), discussionButton, repostButton, shareButton);
|
||||
else actions.append(likeButton, ...(likes > 0 ? [likesStatsButton] : []), shareButton, discussionButton);
|
||||
const supportBtn = document.createElement('button');
|
||||
supportBtn.type = 'button';
|
||||
supportBtn.className = 'ui-button channel-action-item channel-action-support';
|
||||
supportBtn.textContent = '♥ SOL';
|
||||
supportBtn.title = t('screens.support_phase2.donate');
|
||||
supportBtn.addEventListener('click', (event) => { event.stopPropagation(); handlers.onSupport?.(node, target); });
|
||||
|
||||
actions.append(supportBtn);
|
||||
menuItems.unshift({ label: t('screens.channel_thread_view.text_009'), iconHtml: iconHtml('reply'), action: () => replyButton.click() });
|
||||
// Те же действия, что у ответов в обсуждении.
|
||||
menuItems.splice(1, 0, { label: t('screens.channel_thread_view.text_010'), iconHtml: iconHtml('copy'), action: async () => {
|
||||
@@ -1257,6 +1267,14 @@ function renderComment({ node, parent, focus, channelOwner, handlers, nested = f
|
||||
|
||||
// Ряд действий как у записи канала: лайк, ответы, репост, поделиться.
|
||||
actions.append(like, ...(likes > 0 ? [commentLikeStats] : []), reply, repost, share);
|
||||
const supportBtn = document.createElement('button');
|
||||
supportBtn.type = 'button';
|
||||
supportBtn.className = 'channel-action-item thread-comment__support';
|
||||
supportBtn.textContent = '♥ SOL';
|
||||
supportBtn.title = t('screens.support_phase2.donate');
|
||||
supportBtn.addEventListener('click', (event) => { event.stopPropagation(); handlers.onSupport?.(node, target); });
|
||||
actions.append(supportBtn);
|
||||
|
||||
main.append(actions);
|
||||
item.append(who, main);
|
||||
// Как в Threads: нажатие на ответ открывает его обсуждение (кнопки, ссылки и вложения работают сами по себе).
|
||||
@@ -1678,6 +1696,21 @@ export function render({ navigate, route, chrome }) {
|
||||
// Пришли по «Обсуждение» из ленты – после первой загрузки сразу открыть редактор ответа.
|
||||
let openEditorOnLoad = consumeReplyEditorOnOpen(window.location.pathname);
|
||||
const handlers = {
|
||||
onSupport: (node, target) => {
|
||||
const rootNumber = selector?.channel?.channelRootBlockNumber;
|
||||
const rootHash = String(selector?.channel?.channelRootBlockHash || '').trim();
|
||||
const messageHash = String(target?.blockHash || '').trim();
|
||||
const recipientLogin = String(node?.authorLogin || '').trim();
|
||||
if (!recipientLogin || !Number.isSafeInteger(Number(rootNumber))
|
||||
|| !/^[0-9a-f]{64}$/i.test(rootHash) || !/^[0-9a-f]{64}$/i.test(messageHash)) {
|
||||
showToast(t('screens.support_phase2.invalid_target'), { kind: 'error' });
|
||||
return;
|
||||
}
|
||||
openShineSupportDialog({ recipientLogin, target: {
|
||||
type: 2, channelBlockNumber: BigInt(rootNumber), channelBlockHash: hexHash32(rootHash),
|
||||
messageBlockNumber: BigInt(target.blockNumber), messageBlockHash: hexHash32(messageHash),
|
||||
} });
|
||||
},
|
||||
navigate,
|
||||
isActive: () => !disposed,
|
||||
openReplyEditor: (node) => replyEditorOpener?.(node),
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { openShineSupportDialog } from '../components/shine-support-dialog.js';
|
||||
import { hexHash32 } from '../services/shine-support-amount.js';
|
||||
import { loadVerifiedSupportTotals, formatVerifiedSupportLamports } from '../services/support-totals-service.js';
|
||||
import { formatDateTime, getIntlLocale } from '../i18n/format.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { appendShineMessageLinks } from '../services/shine-message-links.js';
|
||||
@@ -2155,9 +2158,42 @@ function renderPostCard(post, {
|
||||
if (!REPOSTS_ENABLED) { notifyRepostSoon(); return; }
|
||||
void onRepost?.(post.messageRef);
|
||||
});
|
||||
// Support posts through the verified on-chain 90/10 flow (separate from likes).
|
||||
const supportButton = document.createElement('button');
|
||||
supportButton.type = 'button';
|
||||
supportButton.className = 'ui-button channel-action-item channel-action-support';
|
||||
supportButton.textContent = '♥ SOL';
|
||||
supportButton.title = t('screens.support_phase2.donate');
|
||||
// Проверенные сервером суммы; если индексатор не готов, число не показываем.
|
||||
if (post.messageRef?.blockNumber != null && post.messageRef?.blockHash) {
|
||||
const messageId = `${String(post.messageRef.blockNumber)}:${String(post.messageRef.blockHash).toLowerCase()}`;
|
||||
void loadVerifiedSupportTotals(selector).then((totals) => {
|
||||
if (!totals || !supportButton.isConnected) return;
|
||||
const formatted = formatVerifiedSupportLamports(totals.messages.get(messageId));
|
||||
if (formatted) supportButton.textContent = `♥ ${formatted}`;
|
||||
});
|
||||
}
|
||||
|
||||
supportButton.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
const messageRef = post.messageRef;
|
||||
const rootHash = String(selector?.channelRootBlockHash || '');
|
||||
const msgHash = String(messageRef?.blockHash || '');
|
||||
const recipient = String(post.authorLogin || '').trim();
|
||||
if (!recipient || !/^[0-9a-f]{64}$/i.test(rootHash) || !/^[0-9a-f]{64}$/i.test(msgHash)) {
|
||||
showToast(t('screens.support_phase2.invalid_target'), { kind: 'error' });
|
||||
return;
|
||||
}
|
||||
openShineSupportDialog({ recipientLogin: recipient, target: {
|
||||
type: 2,
|
||||
channelBlockNumber: BigInt(selector.channelRootBlockNumber), channelBlockHash: hexHash32(rootHash),
|
||||
messageBlockNumber: BigInt(messageRef.blockNumber), messageBlockHash: hexHash32(msgHash),
|
||||
} });
|
||||
});
|
||||
// Четыре кнопки как в Threads: лайк, ответы, репост, поделиться.
|
||||
if (threadsLayout) actions.append(likeButton, ...(Number(post.likesCount) > 0 ? [likesStatsButton] : []), discussionButton, repostButton, shareButton);
|
||||
else actions.append(likeButton, ...(Number(post.likesCount) > 0 ? [likesStatsButton] : []), shareButton, discussionButton);
|
||||
actions.append(supportButton);
|
||||
if (selector?.publicOrdinalUrlsAllowed && post.messageRef?.blockNumber != null) {
|
||||
const streamRoute = makeShineChannelStreamRoute({
|
||||
ownerBlockchainName: selector?.ownerBlockchainName,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { attachSupportStats } from '../components/support-stats.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { profile } from '../mock-data.js';
|
||||
import { state } from '../state.js';
|
||||
@@ -66,6 +67,7 @@ export function render({ navigate, chrome }) {
|
||||
<button class="nav-row" type="button" data-self-profile-action="profiles"><span class="nav-row__label">${th('screens.profile_view.text_015')}</span><span class="nav-row__hint">${th('screens.profile_view.text_016')}</span></button>
|
||||
</div>`;
|
||||
|
||||
attachSupportStats(body, { login: card.login || login, solanaEndpoint: state.entrySettings.solanaServer, isActive: () => !disposed });
|
||||
avatarPreview = attachProfileAvatarPreview(body.querySelector('.user-profile-avatar-slot'), card);
|
||||
|
||||
status.replaceChildren();
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { openShineSupportDialog } from '../components/shine-support-dialog.js';
|
||||
import { attachSupportStats } from '../components/support-stats.js';
|
||||
import { t } from '../i18n/index.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
import { SHINE_CONNECTIONS_LOGO_SRC } from '../components/shine-logo.js';
|
||||
@@ -61,9 +63,11 @@ export function render({ navigate, route, chrome }) {
|
||||
profileTileHtml({ icon: 'user-plus', label: t('screens.user_profile_view.text_004'), attrs: 'data-profile-action="add"' }),
|
||||
profileTileHtml({ label: t('screens.user_profile_view.text_005'), attrs: 'data-profile-action="links"', iconMarkup: `<img class="pf-tile-mandala" src="${SHINE_CONNECTIONS_LOGO_SRC}" alt="" aria-hidden="true">` }),
|
||||
profileTileHtml({ icon: 'message', label: t('screens.user_profile_view.text_006'), attrs: 'data-profile-action="chat"' }),
|
||||
profileTileHtml({ icon: 'heart', label: t('screens.support_phase2.donate'), attrs: 'data-profile-action="support"' }),
|
||||
].join(''),
|
||||
});
|
||||
|
||||
attachSupportStats(body, { login: card.login, solanaEndpoint: state.entrySettings.solanaServer, isActive: () => !disposed });
|
||||
syncRelationTile();
|
||||
|
||||
avatarPreview = attachProfileAvatarPreview(body.querySelector('.user-profile-avatar-slot'), card);
|
||||
@@ -121,6 +125,10 @@ export function render({ navigate, route, chrome }) {
|
||||
navigate(makeProfileLinksRoute(card.login));
|
||||
return;
|
||||
}
|
||||
if (action === 'support') {
|
||||
openShineSupportDialog({ recipientLogin: card.login, onSuccess: () => { if (!disposed) renderProfile(); } });
|
||||
return;
|
||||
}
|
||||
if (action === 'chat') {
|
||||
navigate(`chat/${encodeURIComponent(card.login)}`);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { openShineSupportDialog } from '../components/shine-support-dialog.js';
|
||||
import { formatDateTime, formatNumber } from '../i18n/format.js';
|
||||
import { t, th } from '../i18n/index.js';
|
||||
import { getSolanaCluster, confirmSolanaTransactionHttp } from '../services/solana-rpc-gateway.js';
|
||||
@@ -1867,10 +1868,12 @@ export function render({navigate, chrome}) {
|
||||
<button class="primary-btn" id="refresh-balance" style="flex:1;">${th('screens.wallet_view.text_293')}</button>
|
||||
<button class="primary-btn" id="send-sol" style="flex:1;">${th('screens.wallet_view.text_294')}</button>
|
||||
</div>
|
||||
<button class="secondary-btn" id="donate-shine" type="button">${th('screens.support_phase2.donate_shine')}</button>
|
||||
`;
|
||||
|
||||
const refreshBtn = actions.querySelector('#refresh-balance');
|
||||
const sendBtn = actions.querySelector('#send-sol');
|
||||
actions.querySelector('#donate-shine')?.addEventListener('click', () => openShineSupportDialog({ onSuccess: () => void refreshBalance() }));
|
||||
|
||||
const refreshBalance = async () => {
|
||||
if (!walletAddress) {
|
||||
|
||||
Reference in New Issue
Block a user