376
376
377
377
<script >
378
378
import GeoWidget from ' ../components/GeoWidget.vue'
379
- import EosWrapper from ' @/util/EosWrapper'
380
379
const { app , dialog } = require (' electron' ).remote
381
380
const fs = require (' fs' )
382
381
@@ -466,7 +465,7 @@ export default {
466
465
const accountName = this .identity .account_name
467
466
if (accountName .length > 0 ) {
468
467
try {
469
- const eos = new EosWrapper ()
468
+ const eos = new this.$ EosWrapper ()
470
469
const result = await eos .getTable (' vtxdistribut' , ' vtxdistribut' , ' vdexnodes' )
471
470
472
471
let nodeStats = result .find (row => row .account === accountName)
@@ -489,7 +488,7 @@ export default {
489
488
const accountName = this .identity .account_name
490
489
if (accountName .length > 0 ) {
491
490
try {
492
- const eos = new EosWrapper ()
491
+ const eos = new this.$ EosWrapper ()
493
492
const result = await eos .getTable (' vdexdposvote' , ' vdexdposvote' , ' producers' )
494
493
let nodeStats = result .find (row => row .owner === accountName)
495
494
if (nodeStats) {
@@ -511,7 +510,7 @@ export default {
511
510
const accountName = this .identity .account_name
512
511
if (accountName .length > 0 ) {
513
512
try {
514
- const eos = new EosWrapper ()
513
+ const eos = new this.$ EosWrapper ()
515
514
const result = await eos .getTable (' vtxdistribut' , ' vtxdistribut' , ' uptimes' )
516
515
517
516
let nodeStats = result .find (row => row .account === accountName)
@@ -532,7 +531,7 @@ export default {
532
531
},
533
532
async getRegisteredNodes () {
534
533
try {
535
- const eos = new EosWrapper ()
534
+ const eos = new this.$ EosWrapper ()
536
535
const result = await eos .getTable (' vdexdposvote' , ' vdexdposvote' , ' producers' )
537
536
this .registered_nodes = result .length
538
537
this .registered_nodes_names = []
@@ -552,7 +551,7 @@ export default {
552
551
}
553
552
},
554
553
async identify (key ) {
555
- const eos = new EosWrapper ()
554
+ const eos = new this.$ EosWrapper ()
556
555
try {
557
556
let accounts = await eos .getAccounts (key)
558
557
this .identity .account_name = accounts .account_names [0 ] ? accounts .account_names [0 ] : ' '
@@ -577,7 +576,7 @@ export default {
577
576
const accountName = this .identity .account_name
578
577
if (accountName .length > 0 ) {
579
578
try {
580
- const eos = new EosWrapper ()
579
+ const eos = new this.$ EosWrapper ()
581
580
const result = await eos .getTable (' vtxdistribut' , ' vtxdistribut' , ' uptimes' )
582
581
583
582
let nodeStats = result .find (row => row .account === accountName)
@@ -601,7 +600,7 @@ export default {
601
600
const accountName = this .identity .account_name
602
601
if (accountName .length > 0 ) {
603
602
try {
604
- const eos = new EosWrapper ()
603
+ const eos = new this.$ EosWrapper ()
605
604
const result = await eos .getTable (' vdexdposvote' , ' vdexdposvote' , ' voters' )
606
605
607
606
let nodeStats = result .find (row => row .owner === accountName)
@@ -628,7 +627,7 @@ export default {
628
627
const accountName = this .identity .account_name
629
628
if (accountName .length > 0 ) {
630
629
try {
631
- const eos = new EosWrapper ()
630
+ const eos = new this.$ EosWrapper ()
632
631
const result = await eos .getTable (' vdexdposvote' , ' vdexdposvote' , ' producers' )
633
632
634
633
let voteStats = result .find (row => row .owner === accountName)
@@ -660,7 +659,7 @@ export default {
660
659
const accountName = this .identity .account_name
661
660
if (accountName .length > 0 ) {
662
661
try {
663
- const eos = new EosWrapper ()
662
+ const eos = new this.$ EosWrapper ()
664
663
let balance = await eos .getBalance (accountName)
665
664
this .identity .balance = balance[0 ] ? balance[0 ] : ' 0 VTX'
666
665
} catch (error) {
@@ -674,7 +673,7 @@ export default {
674
673
},
675
674
updatePrivate () {
676
675
this .privateDialog = false
677
- const eos = new EosWrapper ()
676
+ const eos = new this.$ EosWrapper ()
678
677
try {
679
678
let publicKey = eos .privateToPublic (this .identity .private_key )
680
679
this .identity .public_key = publicKey
@@ -735,7 +734,7 @@ export default {
735
734
},
736
735
async addNode () {
737
736
try {
738
- const eos = new EosWrapper (this .identity .private_key )
737
+ const eos = new this.$ EosWrapper (this .identity .private_key )
739
738
const result = await eos .api .transact ({
740
739
actions: [{
741
740
account: ' vtxdistribut' ,
@@ -762,7 +761,7 @@ export default {
762
761
},
763
762
async registerNode () {
764
763
try {
765
- const eos = new EosWrapper (this .identity .private_key )
764
+ const eos = new this.$ EosWrapper (this .identity .private_key )
766
765
const result = await eos .api .transact ({
767
766
actions: [{
768
767
account: ' vdexdposvote' ,
@@ -793,7 +792,7 @@ export default {
793
792
},
794
793
async getListOfNodes () {
795
794
await this .getNodes ()
796
- const eos = new EosWrapper ()
795
+ const eos = new this.$ EosWrapper ()
797
796
this .running_nodes = this .nodes .length
798
797
this .getRegisteredNodes ()
799
798
for (var id in this .nodes ) {
@@ -855,7 +854,7 @@ export default {
855
854
nodesToVote .push (this .voting_list [i].account )
856
855
}
857
856
try {
858
- const eos = new EosWrapper (this .identity .private_key )
857
+ const eos = new this.$ EosWrapper (this .identity .private_key )
859
858
const result = await eos .api .transact ({
860
859
actions: [{
861
860
account: ' vdexdposvote' ,
@@ -885,7 +884,7 @@ export default {
885
884
},
886
885
async retreiveReward () {
887
886
try {
888
- const eos = new EosWrapper (this .identity .private_key )
887
+ const eos = new this.$ EosWrapper (this .identity .private_key )
889
888
const result = await eos .api .transact ({
890
889
actions: [{
891
890
account: ' vtxdistribut' ,
0 commit comments