SHA256
Полностью поддерживает английский язык
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
/** Единая стоимость регистрации: цена namespace уже включает депозит PDA. */
|
||||
export const USER_PDA_SPACE = 768; // shine-solana/shine/programs/shine_users/src/settings.rs
|
||||
// Запас для предварительной проверки баланса; сеть списывает фактическую комиссию.
|
||||
@@ -8,9 +9,9 @@ export const LAMPORTS_PER_SOL = 1_000_000_000;
|
||||
export function calculateRegistrationFunding({ namespaceFeeLamports, rentLamports }) {
|
||||
const namespaceFee = BigInt(namespaceFeeLamports);
|
||||
const rent = BigInt(rentLamports);
|
||||
if (namespaceFee < 0n || rent < 0n) throw new Error('Некорректная стоимость регистрации');
|
||||
if (namespaceFee < 0n || rent < 0n) throw new Error(t('remaining.registration_upgrade.invalid_registration_price'));
|
||||
if (namespaceFee < rent) {
|
||||
throw new Error(`Цена namespace (${solFromLamports(namespaceFee)} SOL) меньше депозита PDA (${solFromLamports(rent)} SOL). Регистрация временно недоступна: обратитесь к администратору namespace.`);
|
||||
throw new Error(t('remaining.registration_upgrade.price_below_rent', { price: solFromLamports(namespaceFee), rent: solFromLamports(rent) }));
|
||||
}
|
||||
const projectFee = namespaceFee - rent;
|
||||
const requiredLamports = namespaceFee + REGISTRATION_NETWORK_RESERVE_LAMPORTS;
|
||||
|
||||
Reference in New Issue
Block a user