SHA256
Разделить среды и закрепить лицензии в HEADER 1.0
This commit is contained in:
@@ -1099,7 +1099,7 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
const BLOCK_TYPE_ARCHIVE_HEAD = 80;
|
||||
const CORE_MAX_NUMBER = 2147482623;
|
||||
// Transport namespace актуального standalone Viewer.
|
||||
const SHINE_PROTOCOL_NAMESPACE = 'SHiNE';
|
||||
const SHINE_PROTOCOL_NAMESPACE = new URLSearchParams(location.search).get('network') === 'test' ? 'test5570' : 'SHiNE';
|
||||
const SHINE_ARWEAVE_APP_TAG = SHINE_PROTOCOL_NAMESPACE;
|
||||
const SHINE_ARWEAVE_CHANNEL_TAG = 'c';
|
||||
const BCH_TYPE_TECH = 0;
|
||||
@@ -1950,7 +1950,7 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
seen.add(previous.toLowerCase());
|
||||
}
|
||||
}
|
||||
const license = strict(reader.readBytes(version === 2 ? reader.readU16() : reader.readU8()));
|
||||
const license = strict(reader.readBytes(reader.readU16()));
|
||||
const initialBlockchainKey = base64Url(reader.readBytes(32));
|
||||
reader.ensureDone();
|
||||
return { kind: 'header', login, tag, initialBlockchainKey, accountType, previousAccounts, license };
|
||||
@@ -2040,7 +2040,7 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
}
|
||||
|
||||
function parseBlockchainBody(type, subType, version, bodyBytes, line) {
|
||||
if (version !== 1 && !(type === BCH_TYPE_TECH && subType === BCH_SUBTYPE_HEADER && version === 2)) {
|
||||
if (version !== 1) {
|
||||
return { kind: 'unsupported', reason: `Неподдерживаемая версия body ${version}` };
|
||||
}
|
||||
if (type === BCH_TYPE_TECH && subType === BCH_SUBTYPE_HEADER) {
|
||||
@@ -2095,7 +2095,7 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
const tags=node.tags||[];
|
||||
const expected={App:SHINE_PROTOCOL_NAMESPACE,n:String(core.blockNumber)};
|
||||
if(core.line) expected.l=({2147483645:'P',2147483646:'C',2147483647:'T'})[core.line.lineCode]??String(core.line.lineCode);
|
||||
if(tags.length!==Object.keys(expected).length || Object.entries(expected).some(([name,value])=>tags.filter(t=>t.name===name&&(t.value===value || (name==='App' && t.value==='test5599'))).length!==1)) throw new Error('CORE index tags mismatch');
|
||||
if(tags.length!==Object.keys(expected).length || Object.entries(expected).some(([name,value])=>tags.filter(t=>t.name===name&&t.value===value).length!==1)) throw new Error('CORE index tags mismatch');
|
||||
}
|
||||
|
||||
function refKey(blockchainName, blockNumber, blockHashHex) {
|
||||
@@ -2437,7 +2437,7 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
const gateway = baseUrl(gatewayBaseUrl);
|
||||
const ownerAddress = await arweaveOwnerAddressFromBlockchainKey(blockchainKey);
|
||||
// Author-first: channel is a local view filter, never an Arweave query filter.
|
||||
const tags = [{ name: 'App', values: [SHINE_ARWEAVE_APP_TAG, 'test5599'] }];
|
||||
const tags = [{ name: 'App', values: [SHINE_ARWEAVE_APP_TAG] }];
|
||||
const query = `query($owners:[String!],$tags:[TagFilter!],$after:String){transactions(first:100,after:$after,owners:$owners,tags:$tags,sort:HEIGHT_DESC){pageInfo{hasNextPage}edges{cursor node{id owner{address key} block{height timestamp} bundledIn{id} tags{name value}}}}}`;
|
||||
let after = null;
|
||||
let page = 0;
|
||||
@@ -3354,7 +3354,7 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
function v3RenderBlocks(){ const host=document.getElementById('v3-block-view'); if(!host)return; host.innerHTML=''; const wrap=document.createElement('div'); wrap.className='v3-blocks'; const blocks=(currentBlockchainView?.rawBlocks||V3.blocks||[]).slice().sort((a,b)=>b.blockNumber-a.blockNumber); blocks.forEach(b=>{ const d=document.createElement('details'); d.className='v3-block'; const sm=document.createElement('summary'); sm.textContent=`#${b.blockNumber} · type ${b.type}/${b.subType} · ${formatTimestamp(Number(b.timestampSec)*1000)}`; const pre=document.createElement('pre'); pre.textContent=JSON.stringify({blockNumber:b.blockNumber,type:b.type,subType:b.subType,version:b.version,hash:b.hashHex,prevHash:b.prevHashHex,contentHash:b.contentHashHex,contentDataItemId:b.contentDataItemId,line:b.line,arweaveId:b.arweaveId,body:b.body},(k,v)=>typeof v==='bigint'?String(v):v,2); d.append(sm,pre); wrap.appendChild(d); }); if(!blocks.length)wrap.textContent='Блоки ещё не загружены.'; host.appendChild(wrap); }
|
||||
function v3SetView(mode){ const bv=document.getElementById('v3-block-view'), cb=document.getElementById('content-browser'); document.getElementById('v3-channel-tab').classList.toggle('is-active',mode==='channel'); document.getElementById('v3-blocks-tab').classList.toggle('is-active',mode==='blocks'); if(bv)bv.hidden=mode!=='blocks'; if(cb)cb.hidden=mode==='blocks'; if(mode==='blocks')v3RenderBlocks(); }
|
||||
async function v3ClearCache(){ try{ const keys=Object.keys(localStorage).filter(k=>k.startsWith('shine.viewer.data.')||k.startsWith('shine.viewer.author-chain.')); keys.forEach(k=>localStorage.removeItem(k)); if('caches' in window){ for(const k of await caches.keys()) if(k.startsWith('shine-viewer-')) await caches.delete(k); } v3Log('Кэш данных очищен'); }catch(e){v3Log('Ошибка очистки кэша: '+e.message);} }
|
||||
function v3CacheKey(key,channel){return 'shine.viewer.author-chain.test5599.'+String(key);}
|
||||
function v3CacheKey(key,channel){return 'shine.viewer.author-chain.'+SHINE_ARWEAVE_APP_TAG+'.'+String(key);}
|
||||
function v3SaveCache(key,channel,blocks){ if(!V3.cacheEnabled)return; try{ localStorage.setItem(v3CacheKey(key,channel),JSON.stringify(blocks,(k,v)=>typeof v==='bigint'?{__bigint:String(v)}:v)); }catch(e){v3Log('Кэш переполнен: '+e.message);} }
|
||||
function v3LoadCache(key,channel){ if(!V3.cacheEnabled)return null; try{return JSON.parse(localStorage.getItem(v3CacheKey(key,channel))||'null',(k,v)=>v&&typeof v==='object'&&v.__bigint!==undefined?BigInt(v.__bigint):v);}catch{return null;} }
|
||||
async function v3RestoreCached(key, channel) {
|
||||
|
||||
Reference in New Issue
Block a user