SHA256
Очередь выплат: минимум 0,1 SOL, запрет системных получателей, автопропуск
- shine_payments: минимальная покупка тикета 0,1 SOL для всех способов покупки (ошибка 37 TicketPurchaseTooSmall). - Получателем нельзя указать System Program, sysvar, встроенные и SPL-программы, сжигатель и программы SHiNE (RESERVED_RECIPIENTS): покупка, тикет менеджера, смена получателя. - step_payout: если получатель не может принять перевод (исполняемый, зарезервированный или после зачисления ниже rent-минимума), тикет закрывается пропуском: вызвавший получает награду, деньги остаются в inflow vault, байт статуса тикета = 2, лог SHINE_PAYMENTS_TICKET_SKIPPED. - Модульные тесты программы (Cargo.toml: включён test). - UI кошелька и очереди: статус «закрыт без выплаты», проверка минимума до отправки; тестовые страницы web/: статус пропуска, минимум и тексты ошибок. - Документация: shine_payments.md, FUNDS_FLOW.md, обзор архитектуры. Сборка и тесты Rust ещё не запускались (нет toolchain на этой машине). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
.err { color: var(--err); white-space: pre-wrap; }
|
||||
.paid { color: var(--ok); font-weight: 700; }
|
||||
.waiting { color: var(--muted); }
|
||||
.skipped { color: var(--warn); font-weight: 700; }
|
||||
.xfer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
|
||||
code { background: var(--code); padding: 2px 4px; border-radius: 4px; }
|
||||
</style>
|
||||
@@ -198,11 +199,14 @@
|
||||
const version = data[o++];
|
||||
const queueId = data[o++];
|
||||
const index = readU64(data, o); o += 8;
|
||||
const isPaid = data[o++] === 1;
|
||||
// Байт статуса: 0 — ожидание, 1 — выплачен, 2 — закрыт пропуском без выплаты.
|
||||
const status = data[o++];
|
||||
const isPaid = status !== 0;
|
||||
const isSkipped = status === 2;
|
||||
const recipient = new solanaWeb3.PublicKey(data.slice(o, o + 32)); o += 32;
|
||||
const payoutUsdCents = readU64(data, o); o += 8;
|
||||
const debtBeforeUsdCents = readU64(data, o); o += 8;
|
||||
return { version, queueId, index, isPaid, recipient, payoutUsdCents, debtBeforeUsdCents };
|
||||
return { version, queueId, index, isPaid, isSkipped, recipient, payoutUsdCents, debtBeforeUsdCents };
|
||||
}
|
||||
|
||||
function getProvider() {
|
||||
@@ -342,7 +346,9 @@
|
||||
const isNext = !!next && next.queue === t.queueId && next.index === t.index;
|
||||
const isOwner = walletPubkey && walletPubkey.toBase58() === t.recipient.toBase58();
|
||||
const canTransfer = !t.isPaid && isOwner && !isNext;
|
||||
const whyBlocked = t.isPaid
|
||||
const whyBlocked = t.isSkipped
|
||||
? "Тикет закрыт без выплаты"
|
||||
: t.isPaid
|
||||
? "Тикет уже выплачен"
|
||||
: !isOwner
|
||||
? "Передача доступна только текущему получателю тикета"
|
||||
@@ -351,7 +357,7 @@
|
||||
: "";
|
||||
return `
|
||||
<div class="panel">
|
||||
<div>Тикет #<b>${t.index.toString()}</b> (очередь <b>${t.queueId}</b>) (<span class="${t.isPaid ? "paid" : "waiting"}">${t.isPaid ? "выплачен" : "ожидание"}</span>)</div>
|
||||
<div>Тикет #<b>${t.index.toString()}</b> (очередь <b>${t.queueId}</b>) (<span class="${t.isSkipped ? "skipped" : (t.isPaid ? "paid" : "waiting")}">${t.isSkipped ? "пропущен: получатель не может принять перевод" : (t.isPaid ? "выплачен" : "ожидание")}</span>)</div>
|
||||
<div>PDA: <code>${pda.toBase58()}</code></div>
|
||||
<div>Получатель: <code>${t.recipient.toBase58()}</code></div>
|
||||
<div>Сумма выплаты: <b>${centsToUsdStr(t.payoutUsdCents)} USD</b> (~${usdCentsToSolStr(t.payoutUsdCents, core.pyth)} SOL)</div>
|
||||
|
||||
Reference in New Issue
Block a user