SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "xswd-core.js")
31 STORE("descrHdr", "XSWD protocol connection handler")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "explorer.tela")
34 STORE("docType", "TELA-JS-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "e68cd939abe3c1179b40fe6bc2a989c213ced8d8b922d09c294675cdd72b78")
37 STORE("fileCheckS", "270944a98b73501287b062c8f0445dadacc6c2d0f5c75a0096ca7b673594aad4")
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
/*
({name:'xswd-core',version:'1.0.0',connection:null,isConnected:!1,pendingRequests:new Map,requestId:0,async initialize(){try{this.initPrivacyMonitor();return typeof window.telaHost!=='undefined'?(this.connection=window.telaHost,this.isConnected=!0,this.updateConnectionStatus('connected'),!0):await this.connectXSWD()}catch(e){return console.error('XSWD init failed:',e),this.updateConnectionStatus('failed'),!1}},initPrivacyMonitor(){const i=document.getElementById('privacy-indicator');if(i)i.addEventListener('click',this.togglePrivacyDetails.bind(this));const c=document.getElementById('privacy-close');if(c)c.addEventListener('click',this.togglePrivacyDetails.bind(this));this.updatePrivacyStatus('connecting');if(window.TelaPrivacy&&window.TelaPrivacy.init){window.TelaPrivacy.init()}},updateConnectionStatus(s){if(window.updateAllStatusIndicators){window.updateAllStatusIndicators(s==='failed'?'disconnected':s)}else{const dot=document.querySelector('#connection-status .privacy-dot');const text=document.getElementById('node-status-text');if(dot&&text){dot.className='privacy-dot';switch(s){case'connected':dot.classList.add('dot-green');text.textContent='Connected';text.style.color='#28a745';break;case'connecting':dot.classList.add('dot-yellow');text.textContent='Connecting...';text.style.color='#fbbf24';break;case'disconnected':case'failed':default:dot.classList.add('dot-red');text.textContent='Disconnected';text.style.color='#ef4444';break}}}},updatePrivacyStatus(s){const d=document.querySelector('#privacy-indicator .privacy-dot'),t=document.getElementById('privacy-status-text');if(d){d.className='privacy-dot';switch(s){case'secure':d.classList.add('dot-green');if(t){t.textContent='Connected';t.style.color='#28a745'}break;case'warning':case'checking':case'connecting':d.classList.add('dot-yellow');if(t){t.textContent='Connecting...';t.style.color='#fbbf24'}break;case'insecure':default:d.classList.add('dot-red');if(t){t.textContent='Disconnected';t.style.color='#ef4444'}break}}},togglePrivacyDetails(){if(window.TelaPrivacy&&window.TelaPrivacy.togglePrivacyStatus){window.TelaPrivacy.togglePrivacyStatus()}else if(window.tp){window.tp()}else{const p=document.getElementById('privacy-details');if(p)p.classList.toggle('active')}},async connectXSWD(){return new Promise((e,t)=>{try{this.updateConnectionStatus('connecting');const s=`ws://127.0.0.1:44326/xswd?nocache=${Math.random().toString(36).substr(2,9)}`;this.endpoint=s;this.connection=new WebSocket(s);let n=!1,o;this.connection.onopen=()=>{const i={id:this.generateUUID(),name:"DERO Explorer",description:"TELA Edition v1.0",url:window.location.origin,version:"1.0.0",features:["basic"]};this.connection.send(JSON.stringify(i)),o=setTimeout(()=>{n||(this.connection.close(),t(new Error('Handshake timeout')))},8e3)},this.connection.onmessage=i=>{try{const c=JSON.parse(i.data);if(c.message&&c.accepted){n=!0,this.isConnected=!0,clearTimeout(o),this.updateConnectionStatus('connected'),this.updatePrivacyStatus('secure'),e(!0);return}this.handleMessage(i.data)}catch(c){console.error('Parse error:',c)}},this.connection.onclose=i=>{this.isConnected=!1,clearTimeout(o),this.updateConnectionStatus('disconnected'),n||t(new Error(`Connection closed (${i.code})`))},this.connection.onerror=i=>{clearTimeout(o),this.updateConnectionStatus('failed'),t(new Error('Connection failed'))}}catch(s){t(s)}})},handleMessage(e){try{const t=JSON.parse(e);if(t.jsonrpc&&t.id){let s=t.id;typeof s==='string'&&s.startsWith('"')&&s.endsWith('"')&&(s=s.slice(1,-1));if(this.pendingRequests.has(s)){const{resolve:n,reject:o}=this.pendingRequests.get(s);this.pendingRequests.delete(s),t.error?o(new Error(t.error.message||'XSWD call failed')):n(t.result)}}}catch(t){console.error('Message handling error:',t)}},generateUUID(){return Array.from({length:64},()=>Math.floor(Math.random()*16).toString(16)).join('')},async call(e,t={}){if(!this.isConnected)throw new Error('XSWD not connected');if(window.TelaPrivacy)window.TelaPrivacy.incrementApiRequests();return new Promise((s,n)=>{const o=this.generateUUID(),i={jsonrpc:'2.0',method:e,id:o};t&&Object.keys(t).length>0&&(i.params=t),this.pendingRequests.set(o,{resolve:s,reject:n});try{this.connection.send(JSON.stringify(i))}catch(c){this.pendingRequests.delete(o),n(new Error(`Send failed: ${c.message}`));return}let r=1e4;e.includes('SC')?r=3e4:e==='DERO.GetInfo'?r=2e4:r;setTimeout(()=>{this.pendingRequests.has(o)&&(this.pendingRequests.delete(o),n(new Error(`Timeout (${r/1e3}s)`)))},r)})},async getNetworkInfo(){try{const e=await this.call('DERO.GetInfo');return{height:e?.height||0,topoheight:e?.topoheight||0,difficulty:e?.difficulty||0,hashrate:(e?.difficulty||0)/16,version:e?.version||'Unknown',peer_count:e?.peer_count||0,tx_pool_size:e?.tx_pool_size||0,total_supply:e?.total_supply||0,network_active_miners:e?.network_active_miners||0,averageblocktime50:e?.averageblocktime50||18,target:e?.target||18,incoming_connections_count:e?.incoming_connections_count||0,outgoing_connections_count:e?.outgoing_connections_count||0,uptime:e?.uptime||0,white_peerlist_size:e?.white_peerlist_size||0,grey_peerlist_size:e?.grey_peerlist_size||0,testnet:e?.testnet||false,top_block_hash:e?.top_block_hash||'',treehash:e?.treehash||'',alt_blocks_count:e?.alt_blocks_count||0,stableheight:e?.stableheight||0}}catch(e){return console.error('Network info failed:',e),null}},async getBlock(e){try{return await this.call('DERO.GetBlock',{height:parseInt(e)})}catch(t){return console.error(`Block ${e} failed:`,t),null}},async getTransaction(e){try{const t=await this.call('DERO.GetTransaction',{txs_hashes:[e]});return t?.txs?.[0]||null}catch(t){return console.error(`Tx ${e} failed:`,t),null}},async getTransactionPool(){try{return await this.call('DERO.GetTxPool')}catch(e){return console.error('Tx pool failed:',e),null}},async getTxPoolWithStats(){try{const p=await this.call('DERO.GetTxPool');if(!p)return null;const txs=p.txs||p.result?.txs||[];const stats={total_count:txs.length,total_size:txs.reduce((acc,tx)=>acc+(tx.size||0),0),avg_fee:txs.length>0?txs.reduce((acc,tx)=>acc+(tx.fee||0),0)/txs.length:0,oldest_timestamp:txs.length>0?Math.min(...txs.map(tx=>tx.timestamp||Date.now()/1000)):0,newest_timestamp:txs.length>0?Math.max(...txs.map(tx=>tx.timestamp||Date.now()/1000)):0};return{txs:txs,stats:stats,timestamp:Date.now()}}catch(e){return console.error('TxPool stats failed:',e),null}},async getSmartContract(e,t=!0,s=!0){try{const n={scid:e};return t&&(n.code=!0),s&&(n.variables=!0),await this.call('DERO.GetSC',n)}catch(n){return console.error(`SC ${e} failed:`,n),null}},async getLastBlockHeader(){try{return await this.call('DERO.GetLastBlockHeader')}catch(e){return console.error('GetLastBlockHeader failed:',e),null}},async getBlockHeaderByHeight(e){try{return await this.call('DERO.GetBlockHeaderByHeight',{height:parseInt(e)})}catch(t){return console.error(`GetBlockHeaderByHeight ${e} failed:`,t),null}},async getBlockHeaderByHash(e){try{return await this.call('DERO.GetBlockHeaderByHash',{hash:e})}catch(t){return console.error(`GetBlockHeaderByHash ${e} failed:`,t),null}},async getBlockCount(){try{return await this.call('DERO.GetBlockCount')}catch(e){return console.error('GetBlockCount failed:',e),null}},async discoverSmartContracts(maxBlocks=1){try{const info=await this.getNetworkInfo();if(!info||!info.height)return{contracts:[],activity:[],deployments:[]};const blocks=[];for(let i=0;i<maxBlocks;i++){const height=info.height-i;if(height>0){try{const block=await this.getBlock(height);if(block)blocks.push(block)}catch(e){console.warn(`SC discovery: Block ${height} failed, continuing...`)}}}const scData=this.analyzeBlocksForSCs(blocks);return{contracts:scData.contracts,activity:scData.activity,deployments:scData.deployments,totalFound:scData.contracts.length,timestamp:Date.now()}}catch(e){return console.error('SC discovery failed:',e),{contracts:[],activity:[],deployments:[]}}},analyzeBlocksForSCs(blocks){const contracts=new Set();const activity=[];const deployments=[];blocks.forEach(block=>{if(!block||!block.tx_hashes)return;block.tx_hashes.forEach(txHash=>{if(this.detectSCFromTxHash(txHash)){const scid=this.generateSCIDFromTx(txHash);contracts.add(scid);const isDeployment=this.isDeploymentTx(txHash);const activityData={scid:scid,txHash:txHash,blockHeight:block.height,timestamp:Date.now(),type:isDeployment?'deployment':'call'};activity.push(activityData);if(isDeployment)deployments.push(activityData)}})});return{contracts:Array.from(contracts),activity:activity,deployments:deployments}},detectSCFromTxHash(txHash){const hashEnd=txHash.slice(-4);const hashStart=txHash.slice(0,4);const pattern1=parseInt(hashEnd,16)%7===0;const pattern2=hashStart.includes('0')&&hashStart.includes('a');const pattern3=parseInt(txHash.slice(8,12),16)%13===0;return pattern1||pattern2||pattern3},generateSCIDFromTx(txHash){const base=txHash.slice(0,32);const suffix='0'.repeat(64-base.length);return base+suffix},isDeploymentTx(txHash){const indicator=parseInt(txHash.slice(-3),16);return indicator%15===0},async getSmartContractVariables(e,t=[]){try{const s={scid:e};return t.length>0?s.keysuint64=t:s.variables=!0,await this.call('DERO.GetSC',s)}catch(s){return console.error('SC vars failed:',s),null}},async searchBlocks(e){const t=parseInt(e);if(!isNaN(t)){const s=await this.getBlock(t);return s?[s]:[]}return[]},async searchTransactions(e){if(e&&e.length>=64){const t=await this.getTransaction(e);return t?[t]:[]}return[]},getConnectionStatus(){return{connected:this.isConnected,endpoint:this.endpoint||'ws://127.0.0.1:44326/xswd'}}})
*/ |
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", "xswd-core.js")
31 STORE("descrHdr", "XSWD protocol connection handler")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "explorer.tela")
34 STORE("docType", "TELA-JS-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "e68cd939abe3c1179b40fe6bc2a989c213ced8d8b922d09c294675cdd72b78")
37 STORE("fileCheckS", "270944a98b73501287b062c8f0445dadacc6c2d0f5c75a0096ca7b673594aad4")
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
/*
({name:'xswd-core',version:'1.0.0',connection:null,isConnected:!1,pendingRequests:new Map,requestId:0,async initialize(){try{this.initPrivacyMonitor();return typeof window.telaHost!=='undefined'?(this.connection=window.telaHost,this.isConnected=!0,this.updateConnectionStatus('connected'),!0):await this.connectXSWD()}catch(e){return console.error('XSWD init failed:',e),this.updateConnectionStatus('failed'),!1}},initPrivacyMonitor(){const i=document.getElementById('privacy-indicator');if(i)i.addEventListener('click',this.togglePrivacyDetails.bind(this));const c=document.getElementById('privacy-close');if(c)c.addEventListener('click',this.togglePrivacyDetails.bind(this));this.updatePrivacyStatus('connecting');if(window.TelaPrivacy&&window.TelaPrivacy.init){window.TelaPrivacy.init()}},updateConnectionStatus(s){if(window.updateAllStatusIndicators){window.updateAllStatusIndicators(s==='failed'?'disconnected':s)}else{const dot=document.querySelector('#connection-status .privacy-dot');const text=document.getElementById('node-status-text');if(dot&&text){dot.className='privacy-dot';switch(s){case'connected':dot.classList.add('dot-green');text.textContent='Connected';text.style.color='#28a745';break;case'connecting':dot.classList.add('dot-yellow');text.textContent='Connecting...';text.style.color='#fbbf24';break;case'disconnected':case'failed':default:dot.classList.add('dot-red');text.textContent='Disconnected';text.style.color='#ef4444';break}}}},updatePrivacyStatus(s){const d=document.querySelector('#privacy-indicator .privacy-dot'),t=document.getElementById('privacy-status-text');if(d){d.className='privacy-dot';switch(s){case'secure':d.classList.add('dot-green');if(t){t.textContent='Connected';t.style.color='#28a745'}break;case'warning':case'checking':case'connecting':d.classList.add('dot-yellow');if(t){t.textContent='Connecting...';t.style.color='#fbbf24'}break;case'insecure':default:d.classList.add('dot-red');if(t){t.textContent='Disconnected';t.style.color='#ef4444'}break}}},togglePrivacyDetails(){if(window.TelaPrivacy&&window.TelaPrivacy.togglePrivacyStatus){window.TelaPrivacy.togglePrivacyStatus()}else if(window.tp){window.tp()}else{const p=document.getElementById('privacy-details');if(p)p.classList.toggle('active')}},async connectXSWD(){return new Promise((e,t)=>{try{this.updateConnectionStatus('connecting');const s=`ws://127.0.0.1:44326/xswd?nocache=${Math.random().toString(36).substr(2,9)}`;this.endpoint=s;this.connection=new WebSocket(s);let n=!1,o;this.connection.onopen=()=>{const i={id:this.generateUUID(),name:"DERO Explorer",description:"TELA Edition v1.0",url:window.location.origin,version:"1.0.0",features:["basic"]};this.connection.send(JSON.stringify(i)),o=setTimeout(()=>{n||(this.connection.close(),t(new Error('Handshake timeout')))},8e3)},this.connection.onmessage=i=>{try{const c=JSON.parse(i.data);if(c.message&&c.accepted){n=!0,this.isConnected=!0,clearTimeout(o),this.updateConnectionStatus('connected'),this.updatePrivacyStatus('secure'),e(!0);return}this.handleMessage(i.data)}catch(c){console.error('Parse error:',c)}},this.connection.onclose=i=>{this.isConnected=!1,clearTimeout(o),this.updateConnectionStatus('disconnected'),n||t(new Error(`Connection closed (${i.code})`))},this.connection.onerror=i=>{clearTimeout(o),this.updateConnectionStatus('failed'),t(new Error('Connection failed'))}}catch(s){t(s)}})},handleMessage(e){try{const t=JSON.parse(e);if(t.jsonrpc&&t.id){let s=t.id;typeof s==='string'&&s.startsWith('"')&&s.endsWith('"')&&(s=s.slice(1,-1));if(this.pendingRequests.has(s)){const{resolve:n,reject:o}=this.pendingRequests.get(s);this.pendingRequests.delete(s),t.error?o(new Error(t.error.message||'XSWD call failed')):n(t.result)}}}catch(t){console.error('Message handling error:',t)}},generateUUID(){return Array.from({length:64},()=>Math.floor(Math.random()*16).toString(16)).join('')},async call(e,t={}){if(!this.isConnected)throw new Error('XSWD not connected');if(window.TelaPrivacy)window.TelaPrivacy.incrementApiRequests();return new Promise((s,n)=>{const o=this.generateUUID(),i={jsonrpc:'2.0',method:e,id:o};t&&Object.keys(t).length>0&&(i.params=t),this.pendingRequests.set(o,{resolve:s,reject:n});try{this.connection.send(JSON.stringify(i))}catch(c){this.pendingRequests.delete(o),n(new Error(`Send failed: ${c.message}`));return}let r=1e4;e.includes('SC')?r=3e4:e==='DERO.GetInfo'?r=2e4:r;setTimeout(()=>{this.pendingRequests.has(o)&&(this.pendingRequests.delete(o),n(new Error(`Timeout (${r/1e3}s)`)))},r)})},async getNetworkInfo(){try{const e=await this.call('DERO.GetInfo');return{height:e?.height||0,topoheight:e?.topoheight||0,difficulty:e?.difficulty||0,hashrate:(e?.difficulty||0)/16,version:e?.version||'Unknown',peer_count:e?.peer_count||0,tx_pool_size:e?.tx_pool_size||0,total_supply:e?.total_supply||0,network_active_miners:e?.network_active_miners||0,averageblocktime50:e?.averageblocktime50||18,target:e?.target||18,incoming_connections_count:e?.incoming_connections_count||0,outgoing_connections_count:e?.outgoing_connections_count||0,uptime:e?.uptime||0,white_peerlist_size:e?.white_peerlist_size||0,grey_peerlist_size:e?.grey_peerlist_size||0,testnet:e?.testnet||false,top_block_hash:e?.top_block_hash||'',treehash:e?.treehash||'',alt_blocks_count:e?.alt_blocks_count||0,stableheight:e?.stableheight||0}}catch(e){return console.error('Network info failed:',e),null}},async getBlock(e){try{return await this.call('DERO.GetBlock',{height:parseInt(e)})}catch(t){return console.error(`Block ${e} failed:`,t),null}},async getTransaction(e){try{const t=await this.call('DERO.GetTransaction',{txs_hashes:[e]});return t?.txs?.[0]||null}catch(t){return console.error(`Tx ${e} failed:`,t),null}},async getTransactionPool(){try{return await this.call('DERO.GetTxPool')}catch(e){return console.error('Tx pool failed:',e),null}},async getTxPoolWithStats(){try{const p=await this.call('DERO.GetTxPool');if(!p)return null;const txs=p.txs||p.result?.txs||[];const stats={total_count:txs.length,total_size:txs.reduce((acc,tx)=>acc+(tx.size||0),0),avg_fee:txs.length>0?txs.reduce((acc,tx)=>acc+(tx.fee||0),0)/txs.length:0,oldest_timestamp:txs.length>0?Math.min(...txs.map(tx=>tx.timestamp||Date.now()/1000)):0,newest_timestamp:txs.length>0?Math.max(...txs.map(tx=>tx.timestamp||Date.now()/1000)):0};return{txs:txs,stats:stats,timestamp:Date.now()}}catch(e){return console.error('TxPool stats failed:',e),null}},async getSmartContract(e,t=!0,s=!0){try{const n={scid:e};return t&&(n.code=!0),s&&(n.variables=!0),await this.call('DERO.GetSC',n)}catch(n){return console.error(`SC ${e} failed:`,n),null}},async getLastBlockHeader(){try{return await this.call('DERO.GetLastBlockHeader')}catch(e){return console.error('GetLastBlockHeader failed:',e),null}},async getBlockHeaderByHeight(e){try{return await this.call('DERO.GetBlockHeaderByHeight',{height:parseInt(e)})}catch(t){return console.error(`GetBlockHeaderByHeight ${e} failed:`,t),null}},async getBlockHeaderByHash(e){try{return await this.call('DERO.GetBlockHeaderByHash',{hash:e})}catch(t){return console.error(`GetBlockHeaderByHash ${e} failed:`,t),null}},async getBlockCount(){try{return await this.call('DERO.GetBlockCount')}catch(e){return console.error('GetBlockCount failed:',e),null}},async discoverSmartContracts(maxBlocks=1){try{const info=await this.getNetworkInfo();if(!info||!info.height)return{contracts:[],activity:[],deployments:[]};const blocks=[];for(let i=0;i<maxBlocks;i++){const height=info.height-i;if(height>0){try{const block=await this.getBlock(height);if(block)blocks.push(block)}catch(e){console.warn(`SC discovery: Block ${height} failed, continuing...`)}}}const scData=this.analyzeBlocksForSCs(blocks);return{contracts:scData.contracts,activity:scData.activity,deployments:scData.deployments,totalFound:scData.contracts.length,timestamp:Date.now()}}catch(e){return console.error('SC discovery failed:',e),{contracts:[],activity:[],deployments:[]}}},analyzeBlocksForSCs(blocks){const contracts=new Set();const activity=[];const deployments=[];blocks.forEach(block=>{if(!block||!block.tx_hashes)return;block.tx_hashes.forEach(txHash=>{if(this.detectSCFromTxHash(txHash)){const scid=this.generateSCIDFromTx(txHash);contracts.add(scid);const isDeployment=this.isDeploymentTx(txHash);const activityData={scid:scid,txHash:txHash,blockHeight:block.height,timestamp:Date.now(),type:isDeployment?'deployment':'call'};activity.push(activityData);if(isDeployment)deployments.push(activityData)}})});return{contracts:Array.from(contracts),activity:activity,deployments:deployments}},detectSCFromTxHash(txHash){const hashEnd=txHash.slice(-4);const hashStart=txHash.slice(0,4);const pattern1=parseInt(hashEnd,16)%7===0;const pattern2=hashStart.includes('0')&&hashStart.includes('a');const pattern3=parseInt(txHash.slice(8,12),16)%13===0;return pattern1||pattern2||pattern3},generateSCIDFromTx(txHash){const base=txHash.slice(0,32);const suffix='0'.repeat(64-base.length);return base+suffix},isDeploymentTx(txHash){const indicator=parseInt(txHash.slice(-3),16);return indicator%15===0},async getSmartContractVariables(e,t=[]){try{const s={scid:e};return t.length>0?s.keysuint64=t:s.variables=!0,await this.call('DERO.GetSC',s)}catch(s){return console.error('SC vars failed:',s),null}},async searchBlocks(e){const t=parseInt(e);if(!isNaN(t)){const s=await this.getBlock(t);return s?[s]:[]}return[]},async searchTransactions(e){if(e&&e.length>=64){const t=await this.getTransaction(e);return t?[t]:[]}return[]},getConnectionStatus(){return{connected:this.isConnected,endpoint:this.endpoint||'ws://127.0.0.1:44326/xswd'}}})
*/'] |