SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "explorer.js")
31 STORE("descrHdr", "Main explorer module coordinator")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "explorer.tela")
34 STORE("docType", "TELA-JS-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "26ae681ea6b77f7d73ac54173f30191756632fd34b869b9a3cd3024330248b0")
37 STORE("fileCheckS", "a94079852da71bde77c1d124828ba096628b7ebac82f785084ae282cc1de27")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
// TELA Explorer - Main Module Coordinator (< 18KB)
// This file coordinates between split explorer modules
// Import and setup explorer modules using main.js module loader
async function initializeExplorerModules() {
// Use the global module loader from main.js
const lm = window.lm || loadModule;
const [blocks, transactions, render] = await Promise.all([
lm('explorer-blocks'),
lm('explorer-transactions'),
lm('explorer-render')
]);
// Store modules globally for cross-module access
window.explorerModules = { blocks, transactions, render };
return { blocks, transactions, render };
}
// Block functions - delegate to explorer-blocks module
async function loadBlocks(xswdCall) {
const modules = await initializeExplorerModules();
if (modules.blocks?.loadBlocks) {
return modules.blocks.loadBlocks(xswdCall);
}
}
async function loadBlock(height) {
const modules = await initializeExplorerModules();
if (modules.blocks?.loadBlock) {
return modules.blocks.loadBlock(height);
}
}
// Transaction functions - delegate to explorer-transactions module
async function loadTransactions() {
const modules = await initializeExplorerModules();
if (modules.transactions?.loadTransactions) {
return modules.transactions.loadTransactions();
}
}
async function loadTransaction(txid) {
const modules = await initializeExplorerModules();
if (modules.transactions?.loadTransaction) {
return modules.transactions.loadTransaction(txid);
}
}
// Utility functions - delegate to render module
async function getPoolData() {
const modules = await initializeExplorerModules();
if (modules.transactions?.getPoolData) {
return modules.transactions.getPoolData();
}
}
async function getRecentBlocks(count = 5) {
const modules = await initializeExplorerModules();
if (modules.transactions?.getRecentBlocks) {
return modules.transactions.getRecentBlocks(count);
}
}
function renderTransactionExplorer(poolData, networkInfo, recentBlocks) {
const modules = window.explorerModules;
if (modules?.render?.renderTransactionExplorer) {
return modules.render.renderTransactionExplorer(poolData, networkInfo, recentBlocks);
}
return '<div class="enhanced-card"><h3>Render module not loaded</h3></div>';
}
function renderAuthenticTxPool(poolData) {
// Legacy function - redirect to enhanced transaction explorer
const networkInfo = window.lastNetworkInfo || {};
return renderTransactionExplorer(poolData, networkInfo, []);
}
// Export functions to global scope for backwards compatibility
window.loadBlocks = loadBlocks;
window.loadBlock = loadBlock;
window.loadTransactions = loadTransactions;
window.loadTransaction = loadTransaction;
window.getPoolData = getPoolData;
window.getRecentBlocks = getRecentBlocks;
window.renderTransactionExplorer = renderTransactionExplorer;
window.renderAuthenticTxPool = renderAuthenticTxPool;
// Pagination is handled by explorer-blocks.js
*/ |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "explorer.js")
31 STORE("descrHdr", "Main explorer module coordinator")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "explorer.tela")
34 STORE("docType", "TELA-JS-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "26ae681ea6b77f7d73ac54173f30191756632fd34b869b9a3cd3024330248b0")
37 STORE("fileCheckS", "a94079852da71bde77c1d124828ba096628b7ebac82f785084ae282cc1de27")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
// TELA Explorer - Main Module Coordinator (< 18KB)
// This file coordinates between split explorer modules
// Import and setup explorer modules using main.js module loader
async function initializeExplorerModules() {
// Use the global module loader from main.js
const lm = window.lm || loadModule;
const [blocks, transactions, render] = await Promise.all([
lm('explorer-blocks'),
lm('explorer-transactions'),
lm('explorer-render')
]);
// Store modules globally for cross-module access
window.explorerModules = { blocks, transactions, render };
return { blocks, transactions, render };
}
// Block functions - delegate to explorer-blocks module
async function loadBlocks(xswdCall) {
const modules = await initializeExplorerModules();
if (modules.blocks?.loadBlocks) {
return modules.blocks.loadBlocks(xswdCall);
}
}
async function loadBlock(height) {
const modules = await initializeExplorerModules();
if (modules.blocks?.loadBlock) {
return modules.blocks.loadBlock(height);
}
}
// Transaction functions - delegate to explorer-transactions module
async function loadTransactions() {
const modules = await initializeExplorerModules();
if (modules.transactions?.loadTransactions) {
return modules.transactions.loadTransactions();
}
}
async function loadTransaction(txid) {
const modules = await initializeExplorerModules();
if (modules.transactions?.loadTransaction) {
return modules.transactions.loadTransaction(txid);
}
}
// Utility functions - delegate to render module
async function getPoolData() {
const modules = await initializeExplorerModules();
if (modules.transactions?.getPoolData) {
return modules.transactions.getPoolData();
}
}
async function getRecentBlocks(count = 5) {
const modules = await initializeExplorerModules();
if (modules.transactions?.getRecentBlocks) {
return modules.transactions.getRecentBlocks(count);
}
}
function renderTransactionExplorer(poolData, networkInfo, recentBlocks) {
const modules = window.explorerModules;
if (modules?.render?.renderTransactionExplorer) {
return modules.render.renderTransactionExplorer(poolData, networkInfo, recentBlocks);
}
return '<div class="enhanced-card"><h3>Render module not loaded</h3></div>';
}
function renderAuthenticTxPool(poolData) {
// Legacy function - redirect to enhanced transaction explorer
const networkInfo = window.lastNetworkInfo || {};
return renderTransactionExplorer(poolData, networkInfo, []);
}
// Export functions to global scope for backwards compatibility
window.loadBlocks = loadBlocks;
window.loadBlock = loadBlock;
window.loadTransactions = loadTransactions;
window.loadTransaction = loadTransaction;
window.getPoolData = getPoolData;
window.getRecentBlocks = getRecentBlocks;
window.renderTransactionExplorer = renderTransactionExplorer;
window.renderAuthenticTxPool = renderAuthenticTxPool;
// Pagination is handled by explorer-blocks.js
*/'] |