How to use tx1 method in wpt

Best JavaScript code snippet using wpt

wellcharts.js

Source:wellcharts.js Github

copy

Full Screen

1var chart;2$(function() {3 try{4 //prepare values5 data = []; 6 data10 = [];7 data11 = [];8 data22 = [];9 mdata10 = [];10 mdata11 = [];11 mldata10 = [];12 mldata11 = [];13 t4 =0;14 for (var t = 0; t < numbs916; t++){15 data.push({x: d916[t]["date"]/1, y: d916[t]["value"]});16 if (t>0){17 rx1=100*(Number(d916[t]["tx"])-Number(d916[t-1]["tx"]))/(Number(d916[t]["date"]/1) - Number(d916[t-1]["date"]/1));18 tx1=100*(Number(d916[t]["rx"])-Number(d916[t-1]["rx"]))/(Number(d916[t]["date"]/1) - Number(d916[t-1]["date"]/1));19 } else {rx1=(100*(d916[t]["tx"]))/1; tx1=(100*(d916[t]["rx"]))/1;}20 mrx1=(10000*(d916[t]["mtx"]))/100;21 mtx1=(10000*(d916[t]["mrx"]))/100;22 ml1=(100*(d916[t]["ml"]))/1;23 mlrx1=((d916[t]["mltx"]))/1;24 mltx1=((d916[t]["mlrx"]))/1;25 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};26 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};27 data10.push({x: d916[t]["date"]/1, y: rx1 });28 data11.push({x: d916[t]["date"]/1, y: tx1 });29 mdata10.push({x: d916[t]["date"]/1, y: mrx1 });30 mdata11.push({x: d916[t]["date"]/1, y: mtx1 });31 mldata10.push({x: d916[t]["date"]/1, y: mlrx1 });32 mldata11.push({x: d916[t]["date"]/1, y: mltx1 });33 data22.push({x: d916[t]["date"]/1, y: ml1 });34 35 }36 37 chart = new JSGadget.Chart($("#chart"), { //create chart38 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]39 });40 41 chart.trends[0].data = data22;42 chart.trends[1].data = data10;43 chart.trends[2].data = data11;44 chart.trends[3].data = mdata10;45 chart.trends[4].data = mdata11;46 chart.trends[5].data = data;47 chart.trends[6].data = mldata10;48 chart.trends[7].data = mldata11;49 50 chart.bAxis.setMinMax(d916[0]["date"]/1, d916[numbs916-1]["date"]/1); //set x limits51 chart.lAxis.setMinMax(-1.1, 400.1); //set y limits52 chart.draw(); //draw chart 53}catch(e){}});54var chart2;55$(function() {56 try{57 //prepare values58 data2 = []; //data array59 data12 = [];60 data13 = [];61 data23 = [];62 mdata12 = [];63 mdata13 = [];64 mldata12 = [];65 mldata13 = [];66 for (var t = 0; t < numbs4450; t++){67 data2.push({x: d4450[t]["date"]/1, y: d4450[t]["value"]}); 68 if (t>0){69 rx1=100*(Number(d4450[t]["tx"])-Number(d4450[t-1]["tx"]))/(Number(d4450[t]["date"]/1) - Number(d4450[t-1]["date"]/1));70 tx1=100*(Number(d4450[t]["rx"])-Number(d4450[t-1]["rx"]))/(Number(d4450[t]["date"]/1) - Number(d4450[t-1]["date"]/1));71 } else {rx1=(100*(d4450[t]["tx"]))/1; tx1=(100*(d4450[t]["rx"]))/1;}72 mrx1=(10000*(d4450[t]["mtx"]))/100;73 mtx1=(10000*(d4450[t]["mrx"]))/100;74 mlrx1=((d4450[t]["mltx"]))/1;75 mltx1=((d4450[t]["mlrx"]))/1;76 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};77 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};78 ml1=(100*(d4450[t]["ml"]))/1;79 data12.push({x: d4450[t]["date"]/1, y: rx1 });80 data13.push({x: d4450[t]["date"]/1, y: tx1 });81 mdata12.push({x: d4450[t]["date"]/1, y: mrx1 });82 mdata13.push({x: d4450[t]["date"]/1, y: mtx1 });83 mldata12.push({x: d4450[t]["date"]/1, y: mlrx1 });84 mldata13.push({x: d4450[t]["date"]/1, y: mltx1 });85 data23.push({x: d4450[t]["date"]/1, y: ml1 });86 }87 //create and draw chart88 chart2 = new JSGadget.Chart($("#chart2"), { //create chart89 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]90 });91 92 chart2.trends[0].data = data23;93 chart2.trends[1].data = data12;94 chart2.trends[2].data = data13;95 chart2.trends[3].data = mdata12;96 chart2.trends[4].data = mdata13;97 chart2.trends[5].data = data2;98 chart2.trends[6].data = mldata12;99 chart2.trends[7].data = mldata13;100 101 chart2.bAxis.setMinMax(d4450[0]["date"]/1, d4450[numbs4450-1]["date"]/1); //set x limits102 chart2.lAxis.setMinMax(-1.1, 400.1); //set y limits103 chart2.draw(); //draw chart 104}catch(e){}});105var chart3;106$(function() {107 try{108 //prepare values109 data3 = []; //data array110 data14 = [];111 data15 = [];112 data24 = [];113 mdata14 = [];114 mdata15 = [];115 mldata14 = [];116 mldata15 = [];117 // luchdata14 = [];118 // luchdata15 = [];119 for (var t = 0; t < numbs631; t++){120 data3.push({x: d631[t]["date"]/1, y: d631[t]["value"]});121 if (t>0 && (Number(d631[t]["tx"]))>0 && (Number(d631[t]["rx"])>0)&& (Number(d631[t-1]["tx"]))>0 && (Number(d631[t-1]["rx"])>0)){122 rx1=100*(Number(d631[t]["tx"])-Number(d631[t-1]["tx"]))/(Number(d631[t]["date"]/1) - Number(d631[t-1]["date"]/1));123 tx1=100*(Number(d631[t]["rx"])-Number(d631[t-1]["rx"]))/(Number(d631[t]["date"]/1) - Number(d631[t-1]["date"]/1));124 } else {rx1=(100*(d631[t]["tx"]))/1; tx1=(100*(d631[t]["rx"]))/1;}125 mrx1=(10000*(d631[t]["mtx"]))/100;126 mtx1=(10000*(d631[t]["mrx"]))/100;127 mlrx1=((d631[t]["mltx"]))/1;128 mltx1=((d631[t]["mlrx"]))/1;129 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};130 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};131 //console.log(Number(d631[t]["luchtx"]));132 // if (t>0){133 134 // if ((Number(d631[t]["luchtx"]))>0) {135 // luchtx1=300;}136 // else {luchtx1=0;}137 138 // if (Number(d631[t]["luchtx"])==-1){139 // luchtx1=280;140 // //console.log(Number(d631[t]["luchtx"]));141 // }142 // }else{143 // if (Number(d631[t]["luchtx"])>0){144 // luchtx1=300;145 // } else {luchtx1=0;}146 // } 147 // luchrx1=((d631[t]["luchtx"])/10);148 ml1=(100*(d631[t]["ml"]))/1;149 data14.push({x: d631[t]["date"]/1, y: rx1 });150 data15.push({x: d631[t]["date"]/1, y: tx1 });151 mdata14.push({x: d631[t]["date"]/1, y: mrx1 });152 mdata15.push({x: d631[t]["date"]/1, y: mtx1 });153 mldata14.push({x: d631[t]["date"]/1, y: mlrx1 });154 mldata15.push({x: d631[t]["date"]/1, y: mltx1 });155 data24.push({x: d631[t]["date"]/1, y: ml1 });156 // luchdata14.push({x: d631[t]["date"]/1, y: luchrx1 });157 // luchdata15.push({x: d631[t]["date"]/1, y: luchtx1 });158 }159 //create and draw chart160 chart3 = new JSGadget.Chart($("#chart3"), { //create chart161 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1}),new JSGadget.ATrend({color: "Red", width: 1}),new JSGadget.ATrend({color: "Red", width: 1})]162 });163 164 chart3.trends[0].data = data24;165 chart3.trends[1].data = data14;166 chart3.trends[2].data = data15;167 chart3.trends[3].data = mdata14;168 chart3.trends[4].data = mdata15;169 chart3.trends[5].data = data3;170 chart3.trends[6].data = mldata14;171 chart3.trends[7].data = mldata15;172 // chart3.trends[8].data = luchdata14;173 // chart3.trends[9].data = luchdata15;174 175 chart3.bAxis.setMinMax(d631[0]["date"]/1, d631[numbs631-1]["date"]/1); //set x limits176 chart3.lAxis.setMinMax(-1.1, 400.1); //set y limits177 chart3.draw(); //draw chart 178}catch(e){}});179var chart4;180$(function() {181 try{182 //prepare values183 data4 = []; //data array184 data16 = [];185 data17 = [];186 data25 = [];187 mdata16 = [];188 mdata17 = [];189 mldata16 = [];190 mldata17 = [];191 for (var t = 0; t < numbs110; t++){192 data4.push({x: d110[t]["date"]/1, y: d110[t]["value"]});193 if (t>0){194 rx1=100*(Number(d110[t]["tx"])-Number(d110[t-1]["tx"]))/(Number(d110[t]["date"]/1) - Number(d110[t-1]["date"]/1));195 tx1=100*(Number(d110[t]["rx"])-Number(d110[t-1]["rx"]))/(Number(d110[t]["date"]/1) - Number(d110[t-1]["date"]/1));196 } else {rx1=(100*(d110[t]["tx"]))/1; tx1=(100*(d110[t]["rx"]))/1;}197 mrx1=(10000*(d110[t]["mtx"]))/100;198 mtx1=(10000*(d110[t]["mrx"]))/100;199 ml1=(100*(d110[t]["ml"]))/1;200 mlrx1=((d110[t]["mltx"]))/1;201 mltx1=((d110[t]["mlrx"]))/1;202 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};203 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};204 data16.push({x: d110[t]["date"]/1, y: rx1 });205 data17.push({x: d110[t]["date"]/1, y: tx1 });206 mdata16.push({x: d110[t]["date"]/1, y: mrx1 });207 mdata17.push({x: d110[t]["date"]/1, y: mtx1 });208 mldata16.push({x: d110[t]["date"]/1, y: mlrx1 });209 mldata17.push({x: d110[t]["date"]/1, y: mltx1 });210 211 data25.push({x: d110[t]["date"]/1, y: ml1 });212 }213 //create and draw chart214 chart4 = new JSGadget.Chart($("#chart4"), { //create chart215 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]216 });217 218 chart4.trends[0].data = data25;219 chart4.trends[1].data = data16;220 chart4.trends[2].data = data17;221 chart4.trends[3].data = mdata16;222 chart4.trends[4].data = mdata17;223 chart4.trends[5].data = data4;224 chart4.trends[6].data = mldata16;225 chart4.trends[7].data = mldata17;226 chart4.bAxis.setMinMax(d110[0]["date"]/1, d110[numbs110-1]["date"]/1); //set x limits227 chart4.lAxis.setMinMax(-1.1, 400.1); //set y limits228 chart4.draw(); //draw chart 229}catch(e){}});230var chart5;231$(function() {232 try{233 //prepare values234 data5 = []; //data array235 data18 = [];236 data19 = [];237 data26 = [];238 mdata18 = [];239 mdata19 = [];240 mldata18 = [];241 mldata19 = [];242 // luchdata14 = [];243 // luchdata15 = [];244 for (var t = 0; t < numbs224; t++) {245 data5.push({x: d224[t]["date"]/1, y: d224[t]["value"]});246 if (t>0){247 rx1=100*(Number(d224[t]["tx"])-Number(d224[t-1]["tx"]))/(Number(d224[t]["date"]/1) - Number(d224[t-1]["date"]/1));248 tx1=100*(Number(d224[t]["rx"])-Number(d224[t-1]["rx"]))/(Number(d224[t]["date"]/1) - Number(d224[t-1]["date"]/1));249 } else {rx1=(100*(d224[t]["tx"]))/1; tx1=(100*(d224[t]["rx"]))/1;}250 mrx1=(10000*(d224[t]["mtx"]))/100;251 mtx1=(10000*(d224[t]["mrx"]))/100;252 mlrx1=((d224[t]["mltx"]))/1;253 mltx1=((d224[t]["mlrx"]))/1;254 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};255 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};256 257 // if (t>0){258 259 // if ((Number(d224[t]["luchtx"]))>0) {260 // luchtx1=300;}261 // else {luchtx1=0;}262 263 // if (Number(d224[t]["luchtx"])==-1){264 // luchtx1=280;265 // //console.log(Number(d631[t]["luchtx"]));266 // }267 // }else{268 // if (Number(d224[t]["luchtx"])>0){269 // luchtx1=300;270 // } else {luchtx1=0;}271 // } 272 // luchrx1=((d224[t]["luchtx"])/10);273 ml1=(100*(d224[t]["ml"]))/1;274 275 data18.push({x: d224[t]["date"]/1, y: rx1 });276 data19.push({x: d224[t]["date"]/1, y: tx1 });277 mdata18.push({x: d224[t]["date"]/1, y: mrx1 });278 mdata19.push({x: d224[t]["date"]/1, y: mtx1 });279 mldata18.push({x: d224[t]["date"]/1, y: mlrx1 });280 mldata19.push({x: d224[t]["date"]/1, y: mltx1 });281 data26.push({x: d224[t]["date"]/1, y: ml1 });282 // luchdata14.push({x: d224[t]["date"]/1, y: luchrx1 });283 // luchdata15.push({x: d224[t]["date"]/1, y: luchtx1 });284 }285 chart5 = new JSGadget.Chart($("#chart5"), { //create chart286 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1}),new JSGadget.ATrend({color: "Red", width: 1}),new JSGadget.ATrend({color: "Red", width: 1})]287 });288 chart5.trends[0].data = data26;289 chart5.trends[1].data = data18;290 chart5.trends[2].data = data19;291 chart5.trends[3].data = mdata18;292 chart5.trends[4].data = mdata19;293 chart5.trends[5].data = data5;294 chart5.trends[6].data = mldata18;295 chart5.trends[7].data = mldata19;296 // chart5.trends[8].data = luchdata14;297 // chart5.trends[9].data = luchdata15;298 299 // chart5.trends[1].data = data6; //set data300 chart5.bAxis.setMinMax(d224[0]["date"]/1, d224[numbs224-1]["date"]/1); //set x limits301 chart5.lAxis.setMinMax(-1.1, 400.1); //set y limits302 chart5.draw(); //draw chart 303}catch(e){}});304var chart6;305$(function() {306 try{307 //prepare values308 data6 = []; //data array309 data20 = [];310 data21 = [];311 data27 = [];312 mdata20 = [];313 mdata21 = [];314 mldata20 = [];315 mldata21 = [];316 for (var t = 0; t < numbs908; t++){317 data6.push({x: d908[t]["date"]/1, y: d908[t]["value"]}); 318 if (t>0){319 rx1=100*(Number(d908[t]["tx"])-Number(d908[t-1]["tx"]))/(Number(d908[t]["date"]/1) - Number(d908[t-1]["date"]/1));320 tx1=100*(Number(d908[t]["rx"])-Number(d908[t-1]["rx"]))/(Number(d908[t]["date"]/1) - Number(d908[t-1]["date"]/1));321 } else {rx1=(100*(d908[t]["tx"]))/1; tx1=(100*(d908[t]["rx"]))/1;}322 mrx1=(10000*(d908[t]["mtx"]))/100;323 mtx1=(10000*(d908[t]["mrx"]))/100;324 mlrx1=((d908[t]["mltx"]))/1;325 mltx1=((d908[t]["mlrx"]))/1;326 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};327 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};328 ml1=(100*(d908[t]["ml"]))/1;329 data20.push({x: d908[t]["date"]/1, y: rx1 });330 data21.push({x: d908[t]["date"]/1, y: tx1 });331 mdata20.push({x: d908[t]["date"]/1, y: mrx1 });332 mdata21.push({x: d908[t]["date"]/1, y: mtx1 });333 mldata20.push({x: d908[t]["date"]/1, y: mlrx1 });334 mldata21.push({x: d908[t]["date"]/1, y: mltx1 });335 data27.push({x: d908[t]["date"]/1, y: ml1 });336 }337 //create and draw chart338 chart6 = new JSGadget.Chart($("#chart6"), { //create chart339 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]340 });341 342 chart6.trends[0].data = data27;343 chart6.trends[1].data = data20;344 chart6.trends[2].data = data21;345 chart6.trends[3].data = mdata20;346 chart6.trends[4].data = mdata21;347 chart6.trends[5].data = data6;348 chart6.trends[6].data = mldata20;349 chart6.trends[7].data = mldata21;350 chart6.bAxis.setMinMax(d908[0]["date"]/1, d908[numbs908-1]["date"]/1); //set x limits351 chart6.lAxis.setMinMax(-1.1, 400.1); //set y limits352 chart6.draw(); //draw chart 353}catch(e){}});354var chart7;355$(function() {356 try{357 //prepare values358 data7 = []; 359 data8 = [];360 data9 = [];361 data28 = [];362 mdata8 = [];363 mdata9 = [];364 mldata8 = [];365 mldata9 = [];366 for (var t = 0; t < numbs411; t++){367 data7.push({x: d411[t]["date"]/1, y: d411[t]["value"]});368 if (t>0){369 rx1=100*(Number(d411[t]["tx"])-Number(d411[t-1]["tx"]))/(Number(d411[t]["date"]/1) - Number(d411[t-1]["date"]/1));370 tx1=100*(Number(d411[t]["rx"])-Number(d411[t-1]["rx"]))/(Number(d411[t]["date"]/1) - Number(d411[t-1]["date"]/1));371 } else {rx1=(100*(d411[t]["tx"]))/1; tx1=(100*(d411[t]["rx"]))/1;}372 mrx1=(10000*(d411[t]["mtx"]))/100;373 mtx1=(10000*(d411[t]["mrx"]))/100;374 mlrx1=((d411[t]["mltx"]))/1;375 mltx1=((d411[t]["mlrx"]))/1;376 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};377 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};378 ml1=(100*(d411[t]["ml"]))/1;379 data8.push({x: d411[t]["date"]/1, y: rx1 });380 data9.push({x: d411[t]["date"]/1, y: tx1 });381 mdata8.push({x: d411[t]["date"]/1, y: mrx1 });382 mdata9.push({x: d411[t]["date"]/1, y: mtx1 });383 mldata8.push({x: d411[t]["date"]/1, y: mlrx1 });384 mldata9.push({x: d411[t]["date"]/1, y: mltx1 });385 data28.push({x: d411[t]["date"]/1, y: ml1 });386 }387 388 chart7 = new JSGadget.Chart($("#chart7"), { //create chart389 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]390 });391 392 chart7.trends[0].data = data28;393 chart7.trends[1].data = data8;394 chart7.trends[2].data = data9;395 chart7.trends[3].data = mdata8;396 chart7.trends[4].data = mdata9;397 chart7.trends[5].data = data7;398 chart7.trends[6].data = mldata8;399 chart7.trends[7].data = mldata9;400 401 chart7.bAxis.setMinMax(d411[0]["date"]/1, d411[numbs411-1]["date"]/1); //set x limits402 chart7.lAxis.setMinMax(-1.1, 400.1); //set y limits403 chart7.draw(); //draw chart 404}catch(e){}});405var chart8;406$(function() {407 try{408 //prepare values409 data29 = []; 410 data30 = [];411 data31= [];412 data32 = [];413 data40 = [];414 for (var t = 0; t < numbsconn; t++){415 data29.push({x: dconn[t]["date"]/1, y: dconn[t]["p8888"]/1});416 data30.push({x: dconn[t]["date"]/1, y: dconn[t]["p6222055149"]/1});417 data31.push({x: dconn[t]["date"]/1, y: dconn[t]["p8084114180"]/1});418 data32.push({x: dconn[t]["date"]/1, y: dconn[t]["p192168773"]/1});419 data40.push({x: dconn[t]["date"]/1, y: dconn[t]["p31173187210"]/1});420 }421 422 chart8 = new JSGadget.Chart($("#chart8"), { //create chart423 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Purple", width: 1})]424 });425 426 chart8.trends[0].data = data29;427 chart8.trends[1].data = data30;428 chart8.trends[2].data = data31;429 chart8.trends[3].data = data32;430 chart8.trends[4].data = data40;431 chart8.bAxis.setMinMax(dconn[0]["date"]/1, dconn[numbsconn-1]["date"]/1); //set x limits432 chart8.lAxis.setMinMax(-1.1, 200.1); //set y limits433 chart8.draw(); //draw chart 434}catch(e){}});435var chart9;436$(function() {437 try{438 //prepare values439 data33 = []; 440 data34 = [];441 data35 = [];442 data36 = [];443 mdata34 = [];444 mdata35 = [];445 mldata34 = [];446 mldata35 = [];447 for (var t = 0; t < numbs89; t++){448 data33.push({x: d89[t]["date"]/1, y: d89[t]["value"]}); 449 if (t>0){450 rx1=100*(Number(d89[t]["rx"])-Number(d89[t-1]["rx"]))/(Number(d89[t]["date"]/1) - Number(d89[t-1]["date"]/1));451 tx1=100*(Number(d89[t]["tx"])-Number(d89[t-1]["tx"]))/(Number(d89[t]["date"]/1) - Number(d89[t-1]["date"]/1));452 } else {rx1=(100*(d89[t]["rx"]))/1; tx1=(100*(d89[t]["tx"]))/1;}453 mrx1=(10000*(d89[t]["mtx"]))/100;454 mtx1=(10000*(d89[t]["mrx"]))/100;455 mlrx1=((d89[t]["mltx"]))/1;456 mltx1=((d89[t]["mlrx"]))/1;457 ml1=(100*(d89[t]["ml"]))/1;458 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};459 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};460 data34.push({x: d89[t]["date"]/1, y: rx1 });461 data35.push({x: d89[t]["date"]/1, y: tx1 });462 mdata34.push({x: d89[t]["date"]/1, y: mrx1 });463 mdata35.push({x: d89[t]["date"]/1, y: mtx1 });464 mldata34.push({x: d89[t]["date"]/1, y: mlrx1 });465 mldata35.push({x: d89[t]["date"]/1, y: mltx1 });466 data36.push({x: d89[t]["date"]/1, y: ml1 });467 }468 469 chart9 = new JSGadget.Chart($("#chart9"), { //create chart470 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]471 });472 473 chart9.trends[0].data = data36;474 chart9.trends[1].data = data35;475 chart9.trends[2].data = data34;476 chart9.trends[3].data = mdata34;477 chart9.trends[4].data = mdata35;478 chart9.trends[5].data = data33;479 chart9.trends[6].data = mldata34;480 chart9.trends[7].data = mldata35;481 chart9.bAxis.setMinMax(d89[0]["date"]/1, d89[numbs89-1]["date"]/1); //set x limits482 chart9.lAxis.setMinMax(-1.1, 400.1); //set y limits483 chart9.draw(); //draw chart 484}catch(e){}});485var chart10;486$(function() {487 try{488 //prepare values489 data33 = []; 490 data34 = [];491 data35 = [];492 data36 = [];493 mdata34 = [];494 mdata35 = [];495 mldata34 = [];496 mldata35 = [];497 for (var t = 0; t < numbs83; t++){498 data33.push({x: d83[t]["date"]/1, y: d83[t]["value"]});499 if (t>0){500 rx1=100*(Number(d83[t]["rx"])-Number(d83[t-1]["rx"]))/(Number(d83[t]["date"]/1) - Number(d83[t-1]["date"]/1));501 tx1=100*(Number(d83[t]["tx"])-Number(d83[t-1]["tx"]))/(Number(d83[t]["date"]/1) - Number(d83[t-1]["date"]/1));502 } else {rx1=(100*(d83[t]["rx"]))/1; tx1=(100*(d83[t]["tx"]))/1;}503 mrx1=(10000*(d83[t]["mtx"]))/100;504 mtx1=(10000*(d83[t]["mrx"]))/100;505 mlrx1=((d83[t]["mltx"]))/1;506 mltx1=((d83[t]["mlrx"]))/1;507 ml1=(100*(d83[t]["ml"]))/1;508 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};509 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};510 data34.push({x: d83[t]["date"]/1, y: rx1 });511 data35.push({x: d83[t]["date"]/1, y: tx1 });512 mdata34.push({x: d83[t]["date"]/1, y: mrx1 });513 mdata35.push({x: d83[t]["date"]/1, y: mtx1 });514 mldata34.push({x: d83[t]["date"]/1, y: mlrx1 });515 mldata35.push({x: d83[t]["date"]/1, y: mltx1 });516 data36.push({x: d83[t]["date"]/1, y: ml1 });517 }518 519 chart10 = new JSGadget.Chart($("#chart10"), { //create chart520 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]521 });522 523 chart10.trends[0].data = data36;524 chart10.trends[1].data = data35;525 chart10.trends[2].data = data34;526 chart10.trends[3].data = mdata34;527 chart10.trends[4].data = mdata35;528 chart10.trends[5].data = data33;529 chart10.trends[6].data = mldata34;530 chart10.trends[7].data = mldata35;531 532 chart10.bAxis.setMinMax(d83[0]["date"]/1, d83[numbs83-1]["date"]/1); //set x limits533 chart10.lAxis.setMinMax(-1.1, 400.1); //set y limits534 chart10.draw(); //draw chart 535}catch(e){}});536var chart11;537$(function() {538 try{539 //prepare values540 data33 = []; 541 data34 = [];542 data35 = [];543 data36 = [];544 mdata34 = [];545 mdata35 = [];546 mldata34 = [];547 mldata35 = [];548 for (var t = 0; t < numbs401; t++){549 data33.push({x: d401[t]["date"]/1, y: d401[t]["value"]});550 if (t>0){551 rx1=100*(Number(d401[t]["rx"])-Number(d401[t-1]["rx"]))/(Number(d401[t]["date"]/1) - Number(d401[t-1]["date"]/1));552 tx1=100*(Number(d401[t]["tx"])-Number(d401[t-1]["tx"]))/(Number(d401[t]["date"]/1) - Number(d401[t-1]["date"]/1));553 } else {rx1=(100*(d401[t]["rx"]))/1; tx1=(100*(d401[t]["tx"]))/1;}554 mrx1=(10000*(d401[t]["mtx"]))/100;555 mtx1=(10000*(d401[t]["mrx"]))/100;556 mlrx1=((d401[t]["mltx"]))/1;557 mltx1=((d401[t]["mlrx"]))/1;558 ml1=(100*(d401[t]["ml"]))/1;559 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};560 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};561 data34.push({x: d401[t]["date"]/1, y: rx1 });562 data35.push({x: d401[t]["date"]/1, y: tx1 });563 mdata34.push({x: d401[t]["date"]/1, y: mrx1 });564 mdata35.push({x: d401[t]["date"]/1, y: mtx1 });565 mldata34.push({x: d401[t]["date"]/1, y: mlrx1 });566 mldata35.push({x: d401[t]["date"]/1, y: mltx1 });567 data36.push({x: d401[t]["date"]/1, y: ml1 });568 }569 570 chart11 = new JSGadget.Chart($("#chart11"), { //create chart571 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]572 });573 574 chart11.trends[0].data = data36;575 chart11.trends[1].data = data35;576 chart11.trends[2].data = data34;577 chart11.trends[3].data = mdata34;578 chart11.trends[4].data = mdata35;579 chart11.trends[5].data = data33;580 chart11.trends[6].data = mldata34;581 chart11.trends[7].data = mldata35;582 583 chart11.bAxis.setMinMax(d401[0]["date"]/1, d401[numbs401-1]["date"]/1); //set x limits584 chart11.lAxis.setMinMax(-1.1, 400.1); //set y limits585 chart11.draw(); //draw chart 586}catch(e){}});587var chart12;588$(function() {589 try{590 //prepare values591 data33 = []; 592 data34 = [];593 data35 = [];594 data36 = [];595 mdata34 = [];596 mdata35 = [];597 mldata34 = [];598 mldata35 = [];599 for (var t = 0; t < numbs610; t++){600 data33.push({x: d610[t]["date"]/1, y: d610[t]["value"]});601 if (t>0){602 rx1=100*(Number(d610[t]["rx"])-Number(d610[t-1]["rx"]))/(Number(d610[t]["date"]/1) - Number(d610[t-1]["date"]/1));603 tx1=100*(Number(d610[t]["tx"])-Number(d610[t-1]["tx"]))/(Number(d610[t]["date"]/1) - Number(d610[t-1]["date"]/1));604 } else {rx1=(100*(d610[t]["rx"]))/1; tx1=(100*(d610[t]["tx"]))/1;}605 mrx1=(10000*(d610[t]["mtx"]))/100;606 mtx1=(10000*(d610[t]["mrx"]))/100;607 mlrx1=((d610[t]["mltx"]))/1;608 mltx1=((d610[t]["mlrx"]))/1;609 ml1=(100*(d610[t]["ml"]))/1;610 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};611 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};612 data34.push({x: d610[t]["date"]/1, y: rx1 });613 data35.push({x: d610[t]["date"]/1, y: tx1 });614 mdata34.push({x: d610[t]["date"]/1, y: mrx1 });615 mdata35.push({x: d610[t]["date"]/1, y: mtx1 });616 mldata34.push({x: d610[t]["date"]/1, y: mlrx1 });617 mldata35.push({x: d610[t]["date"]/1, y: mltx1 });618 data36.push({x: d610[t]["date"]/1, y: ml1 });619 }620 621 chart12 = new JSGadget.Chart($("#chart12"), { //create chart622 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]623 });624 625 chart12.trends[0].data = data36;626 chart12.trends[1].data = data35;627 chart12.trends[2].data = data34;628 chart12.trends[3].data = mdata34;629 chart12.trends[4].data = mdata35;630 chart12.trends[5].data = data33;631 chart12.trends[6].data = mldata34;632 chart12.trends[7].data = mldata35;633 chart12.bAxis.setMinMax(d610[0]["date"]/1, d610[numbs610-1]["date"]/1); //set x limits634 chart12.lAxis.setMinMax(-1.1, 400.1); //set y limits635 chart12.draw(); //draw chart 636}catch(e){}});637var chart13;638$(function() {639 try{640 //prepare values641 data33 = []; 642 data34 = [];643 data35 = [];644 data36 = [];645 mdata34 = [];646 mdata35 = [];647 mldata34 = [];648 mldata35 = [];649 for (var t = 0; t < numbs627; t++){650 data33.push({x: d627[t]["date"]/1, y: d627[t]["value"]});651 if (t>0){652 rx1=100*(Number(d627[t]["rx"])-Number(d627[t-1]["rx"]))/(Number(d627[t]["date"]/1) - Number(d627[t-1]["date"]/1));653 tx1=100*(Number(d627[t]["tx"])-Number(d627[t-1]["tx"]))/(Number(d627[t]["date"]/1) - Number(d627[t-1]["date"]/1));654 } else {rx1=(100*(d627[t]["rx"]))/1; tx1=(100*(d627[t]["tx"]))/1;}655 mrx1=(10000*(d627[t]["mtx"]))/100;656 mtx1=(10000*(d627[t]["mrx"]))/100;657 mlrx1=((d627[t]["mltx"]))/1;658 mltx1=((d627[t]["mlrx"]))/1;659 ml1=(100*(d627[t]["ml"]))/1;660 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};661 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};662 data34.push({x: d627[t]["date"]/1, y: rx1 });663 data35.push({x: d627[t]["date"]/1, y: tx1 });664 mdata34.push({x: d627[t]["date"]/1, y: mrx1 });665 mdata35.push({x: d627[t]["date"]/1, y: mtx1 });666 mldata34.push({x: d627[t]["date"]/1, y: mlrx1 });667 mldata35.push({x: d627[t]["date"]/1, y: mltx1 });668 data36.push({x: d627[t]["date"]/1, y: ml1 });669 }670 671 chart13 = new JSGadget.Chart($("#chart13"), { //create chart672 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]673 });674 675 chart13.trends[0].data = data36;676 chart13.trends[1].data = data35;677 chart13.trends[2].data = data34;678 chart13.trends[3].data = mdata34;679 chart13.trends[4].data = mdata35;680 chart13.trends[5].data = data33;681 chart13.trends[6].data = mldata34;682 chart13.trends[7].data = mldata35;683 chart13.bAxis.setMinMax(d627[0]["date"]/1, d627[numbs627-1]["date"]/1); //set x limits684 chart13.lAxis.setMinMax(-1.1, 400.1); //set y limits685 chart13.draw(); //draw chart 686}catch(e){}});687var chart14;688$(function() {689 try{690 //prepare values691 data33 = []; 692 data34 = [];693 data35 = [];694 data36 = [];695 mdata34 = [];696 mdata35 = [];697 mldata34 = [];698 mldata35 = [];699 for (var t = 0; t < numbs544; t++){700 data33.push({x: d544[t]["date"]/1, y: d544[t]["value"]});701 if (t>0){702 rx1=100*(Number(d544[t]["rx"])-Number(d544[t-1]["rx"]))/(Number(d544[t]["date"]/1) - Number(d544[t-1]["date"]/1));703 tx1=100*(Number(d544[t]["tx"])-Number(d544[t-1]["tx"]))/(Number(d544[t]["date"]/1) - Number(d544[t-1]["date"]/1));704 } else {rx1=(100*(d544[t]["rx"]))/1; tx1=(100*(d544[t]["tx"]))/1;}705 mrx1=(10000*(d544[t]["mtx"]))/100;706 mtx1=(10000*(d544[t]["mrx"]))/100;707 mlrx1=((d544[t]["mltx"]))/1;708 mltx1=((d544[t]["mlrx"]))/1;709 ml1=(100*(d544[t]["ml"]))/1;710 rx1=rx1/100.0; if (rx1<0.01) {rx1=0;} else {rx1=Math.log(rx1*131.2967)*28.3933;};711 tx1=tx1/100.0; if (tx1<0.01) {tx1=0;} else {tx1=Math.log(tx1*131.2967)*28.3933;};712 data34.push({x: d544[t]["date"]/1, y: rx1 });713 data35.push({x: d544[t]["date"]/1, y: tx1 });714 mdata34.push({x: d544[t]["date"]/1, y: mrx1 });715 mdata35.push({x: d544[t]["date"]/1, y: mtx1 });716 mldata34.push({x: d544[t]["date"]/1, y: mlrx1 });717 mldata35.push({x: d544[t]["date"]/1, y: mltx1 });718 data36.push({x: d544[t]["date"]/1, y: ml1 });719 }720 721 chart14 = new JSGadget.Chart($("#chart14"), { //create chart722 trends: [new JSGadget.ATrend({color: "green", width: 1}),new JSGadget.ATrend({color: "Violet", width: 1}),new JSGadget.ATrend({color: "orange", width: 1}),new JSGadget.ATrend({color: "IndianRed", width: 1}),new JSGadget.ATrend({color: "teal", width: 1}),new JSGadget.ATrend({color: "blue", width: 1}),new JSGadget.ATrend({color: "Black", width: 1}),new JSGadget.ATrend({color: "Maroon", width: 1})]723 });724 725 chart14.trends[0].data = data36;726 chart14.trends[1].data = data35;727 chart14.trends[2].data = data34;728 chart14.trends[3].data = mdata34;729 chart14.trends[4].data = mdata35;730 chart14.trends[5].data = data33;731 chart14.trends[6].data = mldata34;732 chart14.trends[7].data = mldata35;733 chart14.bAxis.setMinMax(d544[0]["date"]/1, d544[numbs544-1]["date"]/1); //set x limits734 chart14.lAxis.setMinMax(-1.1, 400.1); //set y limits735 chart14.draw(); //draw chart 736}catch(e){}});737//function tick() {738 //var t2 = new Date(), tz = tz = t2.getTimezoneOffset() * 60;739 //t2 = t2.getTime() / 1000 - tz;740 //var t1 = t2 - i, t = (t2 / c) % (Math.PI * 2);741 //v.push([t2, Math.sin(t), Math.cos(t)]);742 //if (v.length > i)743 //delete v.shift();744 //if (!chart.lAxis.zoom && !chart.bAxis.zoom) {745 //chart.bAxis.setMinMax(t1, t2);746 //<?php echo 'var d1 = '.json_encode($xy_value).';'; ?>;747 //chart.draw();...

Full Screen

Full Screen

algorandService.js

Source:algorandService.js Github

copy

Full Screen

1import algosdk from 'algosdk';2import eventBus from '@/utils/eventBus';3import { validateTx } from '@/utils/validation';4import {5 TransactionMaker,6 encodeArrayForSDK,7} from '@/utils/transactions';8import { AlgoExplorer } from '@/services/algoExplorer';9import { AlgoSigner } from '@/services/algoSigner';10import {11 ADD_LIQUIDITY, DEPOSIT_LIQUIDITY,12 REMOVE_LIQUIDITY,13 SWAP,14 WITHDRAW,15 WITHDRAW_LIQUIDITY16} from '@/utils/constants';17export default class AlgorandService {18 constructor(signer, ledger, assetPair) {19 this.signer = new AlgoSigner(signer);20 this.ledger = ledger;21 this.assetPair = assetPair;22 this.txMaker = new TransactionMaker(assetPair);23 }24 setAssetPair(assetPair) {25 this.assetPair = assetPair;26 this.txMaker.setAssetPair(assetPair);27 }28 connect() {29 return this.signer.connect();30 }31 getAccounts() {32 return this.signer.accounts({33 ledger: this.ledger34 });35 }36 getAccountData(accountAddress) {37 return this.signer.algod({38 ledger: this.ledger,39 path: `/v2/accounts/${accountAddress}`40 });41 }42 static async getApplicationData(ledger, applicationId) {43 const explorer = new AlgoExplorer(ledger);44 return explorer.fetch(`/v2/applications/${applicationId}`);45 }46 getSuggestedParams() {47 return this.signer.algod({48 ledger: this.ledger,49 path: '/v2/transactions/params'50 });51 }52 async optInApp(accountAddress) {53 const suggestedParams = await this.getSuggestedParams();54 const optInTxn = this.txMaker.makeOptInTx(accountAddress, suggestedParams);55 await validateTx([optInTxn]);56 eventBus.$emit('set-action-message', 'Signing application opt-in...');57 const signedTx = await this.signer.sign(optInTxn);58 eventBus.$emit('set-action-message', 'Sending application opt-in...');59 return await this.signer.send({60 ledger: this.ledger,61 tx: signedTx.blob62 }, false);63 }64 async optInAsset(asset, accountAddress) {65 const suggestedParams = await this.getSuggestedParams();66 const optInTxn = this.txMaker.makeAssetOptInTx(asset, accountAddress, suggestedParams);67 await validateTx([optInTxn]);68 eventBus.$emit('set-action-message', 'Signing asset opt-in...');69 const signedTx = await this.signer.sign(optInTxn);70 eventBus.$emit('set-action-message', 'Sending asset opt-in...');71 return await this.signer.send({72 ledger: this.ledger,73 tx: signedTx.blob74 }, false);75 }76 async addLiquidity(accountAddress, primaryAssetAmount, secondaryAssetAmount) {77 const suggestedParams = await this.getSuggestedParams();78 const tx1 = this.txMaker.makeCallTx(accountAddress, [ADD_LIQUIDITY], suggestedParams);79 const tx2 = this.txMaker.makeSecondaryAssetDepositTx(accountAddress, secondaryAssetAmount, suggestedParams);80 const tx3 = this.txMaker.makePrimaryAssetDepositTx(accountAddress, primaryAssetAmount, suggestedParams);81 await validateTx([tx1, tx2, tx3]);82 const txnGroup = await algosdk.assignGroupID([83 {84 ...tx1,85 appArgs: encodeArrayForSDK([ADD_LIQUIDITY])86 },87 Object.assign({}, tx2),88 Object.assign({}, tx3)89 ]);90 tx1.group = txnGroup[0].group.toString('base64');91 tx2.group = txnGroup[1].group.toString('base64');92 tx3.group = txnGroup[2].group.toString('base64');93 eventBus.$emit('set-action-message', 'Signing 1 of 3 liquidity transactions...');94 const signedTx1 = await this.signer.sign(tx1);95 eventBus.$emit('set-action-message', 'Signing 2 of 3 liquidity transactions...');96 const signedTx2 = await this.signer.sign(tx2);97 eventBus.$emit('set-action-message', 'Signing 3 of 3 liquidity transactions...');98 const signedTx3 = await this.signer.sign(tx3);99 eventBus.$emit('set-action-message', 'Sending liquidity transactions...');100 return await this.signer.send({101 ledger: this.ledger,102 tx: this.txMaker.combineSignedTxs([signedTx1, signedTx2, signedTx3])103 }, false);104 }105 async removeLiquidity(accountAddress, liquidityTokens) {106 const suggestedParams = await this.getSuggestedParams();107 const tx = this.txMaker.makeCallTx(accountAddress, [REMOVE_LIQUIDITY, Number(liquidityTokens)], suggestedParams);108 await validateTx([tx]);109 eventBus.$emit('set-action-message', 'Signing liquidity transaction...');110 const signedTx = await this.signer.sign(tx);111 eventBus.$emit('set-action-message', 'Sending liquidity transaction...');112 return await this.signer.send({113 ledger: this.ledger,114 tx: signedTx.blob115 }, false);116 }117 async swapSecondary(accountAddress, assetAmount) {118 const suggestedParams = await this.getSuggestedParams();119 const tx1 = this.txMaker.makeCallTx(accountAddress, [SWAP], suggestedParams);120 const tx2 = this.txMaker.makeSecondaryAssetDepositTx(accountAddress, assetAmount, suggestedParams);121 await validateTx([tx1, tx2]);122 const txnGroup = await algosdk.assignGroupID([123 {124 ...tx1,125 appArgs: encodeArrayForSDK([SWAP])126 },127 Object.assign({}, tx2),128 ]);129 tx1.group = txnGroup[0].group.toString('base64');130 tx2.group = txnGroup[1].group.toString('base64');131 eventBus.$emit('set-action-message', 'Signing 1 of 2 swap transactions...');132 const signedTx1 = await this.signer.sign(tx1);133 eventBus.$emit('set-action-message', 'Signing 2 of 2 swap transactions...');134 const signedTx2 = await this.signer.sign(tx2);135 eventBus.$emit('set-action-message', 'Sending swap transactions...');136 return await this.signer.send({137 ledger: this.ledger,138 tx: this.txMaker.combineSignedTxs([signedTx1, signedTx2])139 }, false);140 }141 async swapPrimary(accountAddress, assetAmount) {142 const suggestedParams = await this.getSuggestedParams();143 const tx1 = this.txMaker.makeCallTx(accountAddress, [SWAP], suggestedParams);144 const tx2 = this.txMaker.makePrimaryAssetDepositTx(accountAddress, assetAmount, suggestedParams);145 await validateTx([tx1, tx2]);146 const txnGroup = await algosdk.assignGroupID([147 {148 ...tx1,149 appArgs: encodeArrayForSDK([SWAP])150 },151 Object.assign({}, tx2),152 ]);153 tx1.group = txnGroup[0].group.toString('base64');154 tx2.group = txnGroup[1].group.toString('base64');155 eventBus.$emit('set-action-message', 'Signing 1 of 2 swap transactions...');156 const signedTx1 = await this.signer.sign(tx1);157 eventBus.$emit('set-action-message', 'Signing 2 of 2 swap transactions...');158 const signedTx2 = await this.signer.sign(tx2);159 eventBus.$emit('set-action-message', 'Sending swap transactions...');160 return await this.signer.send({161 ledger: this.ledger,162 tx: this.txMaker.combineSignedTxs([signedTx1, signedTx2])163 }, false);164 }165 async depositLiquidity(accountAddress, assetAmount) {166 const suggestedParams = await this.getSuggestedParams();167 const tx1 = this.txMaker.makeCallTx(accountAddress, [DEPOSIT_LIQUIDITY], suggestedParams);168 const tx2 = this.txMaker.makeAssetPaymentTx(this.assetPair.liquidityAsset, accountAddress, this.assetPair.escrowAddress, assetAmount, suggestedParams);169 await validateTx([tx1, tx2]);170 const txnGroup = await algosdk.assignGroupID([171 {172 ...tx1,173 appArgs: encodeArrayForSDK([DEPOSIT_LIQUIDITY])174 },175 Object.assign({}, tx2),176 ]);177 tx1.group = txnGroup[0].group.toString('base64');178 tx2.group = txnGroup[1].group.toString('base64');179 eventBus.$emit('set-action-message', 'Signing 1 of 2 deposit transactions...');180 const signedTx1 = await this.signer.sign(tx1);181 eventBus.$emit('set-action-message', 'Signing 2 of 2 deposit transactions...');182 const signedTx2 = await this.signer.sign(tx2);183 eventBus.$emit('set-action-message', 'Sending deposit transactions...');184 return await this.signer.send({185 ledger: this.ledger,186 tx: this.txMaker.combineSignedTxs([signedTx1, signedTx2])187 });188 }189 async withdrawLiquidity(accountAddress, assetAmount) {190 const suggestedParams = await this.getSuggestedParams();191 const tx1 = this.txMaker.makeCallTx(accountAddress, [WITHDRAW_LIQUIDITY], suggestedParams);192 const tx2 = this.txMaker.makeAssetWithdrawalTx(this.assetPair.liquidityAsset, accountAddress, assetAmount, suggestedParams);193 const tx3 = this.txMaker.makeAlgoPaymentTx(accountAddress, this.assetPair.escrowAddress, 1000, suggestedParams);194 await validateTx([tx1, tx2, tx3]);195 const txnGroup = await algosdk.assignGroupID([196 {197 ...tx1,198 appArgs: encodeArrayForSDK([WITHDRAW_LIQUIDITY])199 },200 tx2,201 tx3202 ]);203 tx1.group = txnGroup[0].group.toString('base64');204 tx3.group = txnGroup[2].group.toString('base64');205 eventBus.$emit('set-action-message', 'Signing 1 of 2 withdrawal transactions...');206 const signedTx1 = await this.signer.sign(tx1);207 const signedTx2 = this.txMaker.logicSign(txnGroup[1]);208 eventBus.$emit('set-action-message', 'Signing 2 of 2 withdrawal transactions...');209 const signedTx3 = await this.signer.sign(tx3);210 eventBus.$emit('set-action-message', 'Sending withdrawal transactions...');211 return await this.signer.send({212 ledger: this.ledger,213 tx: this.txMaker.combineSignedTxs([signedTx1, signedTx2, signedTx3])214 });215 }216 async withdraw(accountAddress, primaryAssetAmount, secondaryAssetAmount) {217 const suggestedParams = await this.getSuggestedParams();218 const tx1 = this.txMaker.makeCallTx(accountAddress, [WITHDRAW], suggestedParams);219 const tx2 = this.txMaker.makeSecondaryAssetWithdrawalTx(accountAddress, secondaryAssetAmount, suggestedParams);220 const tx3 = this.txMaker.makePrimaryAssetWithdrawalTx(accountAddress, primaryAssetAmount, suggestedParams);221 const tx4 = this.txMaker.makeAlgoPaymentTx(accountAddress, this.assetPair.escrowAddress, 2000, suggestedParams);222 await validateTx([tx1, tx2, tx3, tx4]);223 const txnGroup = await algosdk.assignGroupID([224 {225 ...tx1,226 appArgs: encodeArrayForSDK([WITHDRAW])227 },228 tx2,229 tx3,230 Object.assign({}, tx4)231 ]);232 tx1.group = txnGroup[0].group.toString('base64');233 tx4.group = txnGroup[3].group.toString('base64');234 eventBus.$emit('set-action-message', 'Signing 1 of 2 withdrawal transactions...');235 const signedTx1 = await this.signer.sign(tx1);236 const signedTx2 = this.txMaker.logicSign(txnGroup[1]);237 const signedTx3 = this.txMaker.logicSign(txnGroup[2]);238 eventBus.$emit('set-action-message', 'Signing 2 of 2 withdrawal transactions...');239 const signedTx4 = await this.signer.sign(tx4);240 eventBus.$emit('set-action-message', 'Sending withdrawal transactions...');241 return await this.signer.send({242 ledger: this.ledger,243 tx: this.txMaker.combineSignedTxs([signedTx1, signedTx2, signedTx3, signedTx4])244 });245 }...

Full Screen

Full Screen

struct_x_v___hdmi_tx1.js

Source:struct_x_v___hdmi_tx1.js Github

copy

Full Screen

1var struct_x_v___hdmi_tx1 =2[3 [ "Aux", "struct_x_v___hdmi_tx1.html#a2fcf639e71cb04c30a8f00c3ce401f63", null ],4 [ "BrdgLockedCallback", "struct_x_v___hdmi_tx1.html#a1f62d35265c8e9575806e96d5dff4b5a", null ],5 [ "BrdgLockedRef", "struct_x_v___hdmi_tx1.html#add4ef24bbf855bdb99cbc895f3728080", null ],6 [ "BrdgOverflowCallback", "struct_x_v___hdmi_tx1.html#a5ee28de741dedce0c80df05efc6b4393", null ],7 [ "BrdgOverflowRef", "struct_x_v___hdmi_tx1.html#a93b678d829092eb3df9320b2e4e8872a", null ],8 [ "BrdgUnderflowCallback", "struct_x_v___hdmi_tx1.html#a8d72f931c95c5dd096a95792dc005a2a", null ],9 [ "BrdgUnderflowRef", "struct_x_v___hdmi_tx1.html#a72aa05a028a053c769c88887279c84c1", null ],10 [ "BrdgUnlockedCallback", "struct_x_v___hdmi_tx1.html#a41128322a34d6f217ffac92670003c9e", null ],11 [ "BrdgUnlockedRef", "struct_x_v___hdmi_tx1.html#a070e92ea218d1165fda851951553b35a", null ],12 [ "CedUpdateCallback", "struct_x_v___hdmi_tx1.html#a88195ea134a8be086cca6156bd5d87df", null ],13 [ "CedUpdateRef", "struct_x_v___hdmi_tx1.html#a9bf336d986341f807a93dd7aa12d457f", null ],14 [ "Config", "struct_x_v___hdmi_tx1.html#a821b6ed4f07983491f150fb061ba224e", null ],15 [ "ConnectCallback", "struct_x_v___hdmi_tx1.html#aef6b3f6753d278df67f1c9803f667e08", null ],16 [ "ConnectRef", "struct_x_v___hdmi_tx1.html#a99c1d407019995c9faedf34060140f35", null ],17 [ "CpuClkFreq", "struct_x_v___hdmi_tx1.html#aed733a651634b05b6113daf320c32646", null ],18 [ "DynHdrMtwCallback", "struct_x_v___hdmi_tx1.html#aa75eb56d2fcf4058da44bb2a2c3eba9b", null ],19 [ "DynHdrMtwRef", "struct_x_v___hdmi_tx1.html#a027b1a92f27a2b2839254e3a69120fd1", null ],20 [ "FrlConfigCallback", "struct_x_v___hdmi_tx1.html#ac495d5b8980b11427969918c7ea6eb56", null ],21 [ "FrlConfigRef", "struct_x_v___hdmi_tx1.html#a26e0379b6c6b94faae7e5c52aec5e73e", null ],22 [ "FrlFfeCallback", "struct_x_v___hdmi_tx1.html#ada61680a6092bdfeb4057cbd70e07584", null ],23 [ "FrlFfeRef", "struct_x_v___hdmi_tx1.html#a23e3de569323bfc387f1f9e97f409fc1", null ],24 [ "FrlLts1Callback", "struct_x_v___hdmi_tx1.html#a9c4f784b98baa848eaba0f184e4f6cf8", null ],25 [ "FrlLts1Ref", "struct_x_v___hdmi_tx1.html#a7f5ad8e61c677bc4ac96e9673bde9e0d", null ],26 [ "FrlLts2Callback", "struct_x_v___hdmi_tx1.html#a77f9f144ed1b1f0f406bbb8c671b0de3", null ],27 [ "FrlLts2Ref", "struct_x_v___hdmi_tx1.html#ae463ce8fdabc072cd2200d87f5840900", null ],28 [ "FrlLts3Callback", "struct_x_v___hdmi_tx1.html#a54f7b221e53ad112c54f2ef2ab77483a", null ],29 [ "FrlLts3Ref", "struct_x_v___hdmi_tx1.html#a7c82198d3afb1e336b5866f9a538cbda", null ],30 [ "FrlLts4Callback", "struct_x_v___hdmi_tx1.html#ab984cfb1fd3a88d5478b399a0e5ea2ea", null ],31 [ "FrlLts4Ref", "struct_x_v___hdmi_tx1.html#aa5ebb5f0ac5d8311b724bc7c979f909a", null ],32 [ "FrlLtsLCallback", "struct_x_v___hdmi_tx1.html#a77650863384c1b134f3e8a26bb195d50", null ],33 [ "FrlLtsLRef", "struct_x_v___hdmi_tx1.html#a78b99d681974d6fc18685eef62edad06", null ],34 [ "FrlLtsPCallback", "struct_x_v___hdmi_tx1.html#a346dde9dc2fb73ea526587978c14f493", null ],35 [ "FrlLtsPRef", "struct_x_v___hdmi_tx1.html#ac113465b484ed544caa647b3df1cf578", null ],36 [ "FrlStartCallback", "struct_x_v___hdmi_tx1.html#a4a76a4f44c11da6514bfcd2b366ee79a", null ],37 [ "FrlStartRef", "struct_x_v___hdmi_tx1.html#a3676bc4ca72e0c3ac3695124574aa812", null ],38 [ "FrlStopCallback", "struct_x_v___hdmi_tx1.html#abc1b2a59bc184f8461952572773a3b1d", null ],39 [ "FrlStopRef", "struct_x_v___hdmi_tx1.html#a3e2dd2bf272b13923b08e8a811bdef8c", null ],40 [ "IsReady", "struct_x_v___hdmi_tx1.html#abc4e2c7cd581d8e407d845f1a620d3d8", null ],41 [ "Stream", "struct_x_v___hdmi_tx1.html#a8812d5981337da9bcf42bd9ea41bb8ea", null ],42 [ "StreamDownCallback", "struct_x_v___hdmi_tx1.html#a4929690dcb3684990ea7cb5d2f6cb497", null ],43 [ "StreamDownRef", "struct_x_v___hdmi_tx1.html#a29e2afefacc7fffc29d308d28eaa6cba", null ],44 [ "StreamUpCallback", "struct_x_v___hdmi_tx1.html#a01870b62d198af5f708b320a2339f9d3", null ],45 [ "StreamUpRef", "struct_x_v___hdmi_tx1.html#ac371f98870269cb29be2e43d48d3668e", null ],46 [ "TmdsConfigCallback", "struct_x_v___hdmi_tx1.html#a7be7f63d8a5bd9f54b4e186dc82820bc", null ],47 [ "TmdsConfigRef", "struct_x_v___hdmi_tx1.html#adf9d9f60674222a643f9ad7f0c8e4187", null ],48 [ "ToggleCallback", "struct_x_v___hdmi_tx1.html#af48a03329a29f3358af6bc289f510797", null ],49 [ "ToggleRef", "struct_x_v___hdmi_tx1.html#ac0d8301d7b26b1c99874123b07e6be46", null ],50 [ "VrrIF", "struct_x_v___hdmi_tx1.html#a4a1bc4a517334ce2cba4b9c0eb2f4a10", null ],51 [ "VsCallback", "struct_x_v___hdmi_tx1.html#a529cf861436423034baa776592647e3e", null ],52 [ "VsRef", "struct_x_v___hdmi_tx1.html#a12a90e7a33dd7c9ca21603f82912b73d", null ]...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt1.tx1();2wpt2.tx2();3wpt3.tx3();4wpt4.tx4();5wpt5.tx5();6wpt6.tx6();7wpt7.tx7();8wpt8.tx8();9wpt9.tx9();10wpt10.tx10();11wpt11.tx11();12wpt12.tx12();13wpt13.tx13();14wpt14.tx14();15wpt15.tx15();16wpt16.tx16();17wpt17.tx17();18wpt18.tx18();19wpt19.tx19();20wpt20.tx20();21wpt21.tx21();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptx = require('wptx');2wptx.tx1();3var wptx = require('wptx');4wptx.tx1();5var wptx = require('wptx');6wptx.tx1();7var wptx = require('wptx');8wptx.tx1();9var wptx = require('wptx');10wptx.tx1();11var wptx = require('wptx');12wptx.tx1();13var wptx = require('wptx');14wptx.tx1();15var wptx = require('wptx');16wptx.tx1();17var wptx = require('wptx');18wptx.tx1();19var wptx = require('wptx');20wptx.tx1();21var wptx = require('wptx');22wptx.tx1();23var wptx = require('wptx');24wptx.tx1();25var wptx = require('wptx');26wptx.tx1();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptx1 = require('./wptx1');2var tx1 = wptx1.tx1;3tx1();4exports.tx1 = function() {5 console.log("tx1");6}7var wptx1 = require('./wptx1');8var tx1 = wptx1.tx1;9tx1();10exports.tx1 = function() {11 console.log("tx1");12}13var wptx1 = require('./wptx1');14var tx1 = wptx1.tx1;15tx1();16exports.tx1 = function() {17 console.log("tx1");18}19var wptx1 = require('./wptx1');20var tx1 = wptx1.tx1;21tx1();22exports.tx1 = function() {23 console.log("tx1");24}25var wptx1 = require('./wptx1');26var tx1 = wptx1.tx1;27tx1();28exports.tx1 = function() {29 console.log("tx1");30}31var wptx1 = require('./wptx1');32var tx1 = wptx1.tx1;33tx1();34exports.tx1 = function() {35 console.log("tx1");36}37var fs = require('fs');38fs.readdirSync('./').forEach(function(file){

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt.tx1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);2wpt.tx2(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);3wpt.tx3(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);4wpt.tx4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);5wpt.tx5(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);6wpt.tx6(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);7wpt.tx7(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);8wpt.tx8(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);9wpt.tx9(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);10wpt.tx10(1, 2, 3, 4, 5, 6, 7, 8, 9

Full Screen

Using AI Code Generation

copy

Full Screen

1var tx1 = require('./wptx1');2var tx1 = new tx1();3tx1.tx1();4var tx1 = function() {5 this.tx1 = function() {6 console.log("tx1");7 }8}9module.exports = tx1;

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var wpt = new wpt('API_KEY');3wpt.tx1('www.webpagetest.org', function(err, data) {4 console.log(data);5});6var wpt = require('wpt');7var wpt = new wpt('API_KEY');8wpt.tx2('www.webpagetest.org', function(err, data) {9 console.log(data);10});11var wpt = require('wpt');12var wpt = new wpt('API_KEY');13wpt.tx3('www.webpagetest.org', function(err, data) {14 console.log(data);15});16var wpt = require('wpt');17var wpt = new wpt('API_KEY');18wpt.tx4('www.webpagetest.org', function(err, data) {19 console.log(data);20});21var wpt = require('wpt');22var wpt = new wpt('API_KEY');23wpt.tx5('www.webpagetest.org', function(err, data) {24 console.log(data);25});26var wpt = require('wpt');27var wpt = new wpt('API_KEY');28wpt.tx6('www.webpagetest.org', function(err, data) {29 console.log(data);30});31var wpt = require('wpt');32var wpt = new wpt('API_KEY');33wpt.tx7('www.webpagetest.org', function(err, data) {34 console.log(data);35});36var wpt = require('wpt');37var wpt = new wpt('API_KEY');38wpt.tx8('www.webpagetest.org', function(err, data) {39 console.log(data);40});41var wpt = require('wpt');

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful