SHA256
Улучшить ссылки и прокрутку личных чатов
This commit is contained in:
@@ -7,6 +7,16 @@ export function setSolanaCluster(value) {
|
||||
cluster = next;
|
||||
}
|
||||
export function getSolanaCluster() { return cluster; }
|
||||
export function makeSolanaExplorerTxUrl(signature, endpoint = '') {
|
||||
const cleanSignature = String(signature || '').trim();
|
||||
if (!cleanSignature) return '';
|
||||
const configured = getSolanaCluster();
|
||||
const source = String(endpoint || '').trim().toLowerCase();
|
||||
const network = configured || (source.includes('devnet') ? 'devnet' : source.includes('testnet') ? 'testnet' : 'mainnet-beta');
|
||||
const url = new URL(`https://explorer.solana.com/tx/${encodeURIComponent(cleanSignature)}`);
|
||||
if (network !== 'mainnet-beta') url.searchParams.set('cluster', network);
|
||||
return url.toString();
|
||||
}
|
||||
export function rpcEndpointFromShineHttp(httpBase) {
|
||||
const base = String(httpBase || '').trim();
|
||||
if (!/^https?:\/\//i.test(base)) throw new Error('SHiNE server HTTP address is unavailable');
|
||||
|
||||
Reference in New Issue
Block a user