mirror of
https://github.com/linuxserver/nano-wallet.git
synced 2026-02-20 06:17:26 +08:00
2 lines
78 KiB
JavaScript
2 lines
78 KiB
JavaScript
(function(t){function e(e){for(var a,r,o=e[0],c=e[1],l=e[2],u=0,p=[];u<o.length;u++)r=o[u],Object.prototype.hasOwnProperty.call(s,r)&&s[r]&&p.push(s[r][0]),s[r]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(t[a]=c[a]);d&&d(e);while(p.length)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],a=!0,r=1;r<n.length;r++){var c=n[r];0!==s[c]&&(a=!1)}a&&(i.splice(e--,1),t=o(o.s=n[0]))}return t}var a={},s={app:0},i=[];function r(t){return o.p+"js/"+({about:"about"}[t]||t)+"."+{about:"d989465d"}[t]+".js"}function o(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(t){var e=[],n=s[t];if(0!==n)if(n)e.push(n[2]);else{var a=new Promise((function(e,a){n=s[t]=[e,a]}));e.push(n[2]=a);var i,c=document.createElement("script");c.charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.src=r(t);var l=new Error;i=function(e){c.onerror=c.onload=null,clearTimeout(u);var n=s[t];if(0!==n){if(n){var a=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,n[1](l)}s[t]=void 0}};var u=setTimeout((function(){i({type:"timeout",target:c})}),12e4);c.onerror=c.onload=i,document.head.appendChild(c)}return Promise.all(e)},o.m=t,o.c=a,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/",o.oe=function(t){throw console.error(t),t};var c=window["webpackJsonp"]=window["webpackJsonp"]||[],l=c.push.bind(c);c.push=e,c=c.slice();for(var u=0;u<c.length;u++)e(c[u]);var d=l;i.push([2,"chunk-vendors"]),n()})({0:function(t,e){},"0bee":function(t,e,n){"use strict";var a=n("3ae5"),s=n.n(a);s.a},"0e4f":function(t,e,n){},1:function(t,e){},1594:function(t,e,n){},2:function(t,e,n){t.exports=n("56d7")},"2dca":function(t,e,n){"use strict";var a=n("6939"),s=n.n(a);s.a},3:function(t,e){},"3ae5":function(t,e,n){},4:function(t,e){},"56d7":function(t,e,n){"use strict";n.r(e);var a={};n.r(a),n.d(a,"nodeLink",(function(){return xe}));var s={};n.r(s),n.d(s,"pow",(function(){return Ce})),n.d(s,"ready",(function(){return _e})),n.d(s,"privatekey",(function(){return Se})),n.d(s,"node",(function(){return Te})),n.d(s,"history",(function(){return Ae})),n.d(s,"pending",(function(){return Re})),n.d(s,"balance",(function(){return $e})),n.d(s,"resetState",(function(){return Oe}));var i={};n.r(i),n.d(i,"node",(function(){return Be})),n.d(i,"getSeed",(function(){return Fe})),n.d(i,"seedData",(function(){return Le})),n.d(i,"getDetails",(function(){return We})),n.d(i,"rpCall",(function(){return He})),n.d(i,"history",(function(){return qe})),n.d(i,"pending",(function(){return Qe})),n.d(i,"resetState",(function(){return ze}));n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("2b0e"),o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view"),n("notifications",{attrs:{position:"top center"}})],1)},c=[],l={name:"App",components:{},data:function(){return{key:null}},watch:{$route:function(){this.$store.dispatch("app/node")}},created:function(){this.$store.dispatch("app/node")}},u=l,d=(n("5c0b"),n("2877")),p=Object(d["a"])(u,o,c,!1,null,null,null),v=p.exports,f=(n("d3b7"),n("8c4f")),h=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wallet"},[n("div",{attrs:{type:"hidden",id:"workstorage"}}),n("div",{staticClass:"page",class:{active:!1===t.open},attrs:{id:"login"}},[n("div",{staticClass:"title rpc"},[t._v("RPC Server : "),n("span",[t._v(t._s(t.$store.state.app.node.address))])]),n("div",{attrs:{id:"inputs"}},[null!==t.error?n("div",{staticClass:"error"},[t._v(t._s(t.error))]):t._e(),n("div",{staticClass:"labeltabs"},[n("label",{staticClass:"df",class:{active:!0===t.seedtab},attrs:{for:"seed"},on:{click:t.setSeed}},[t._v(" Seed ")]),n("label",{staticClass:"df",class:{active:!0!==t.seedtab},attrs:{for:"key"},on:{click:t.setPrivate}},[t._v(" Private Key ")]),!0===t.seedtab?n("a",{staticClass:"morebutton mla",attrs:{href:""},on:{click:function(e){e.preventDefault(),t.showadvanced=!t.showadvanced}}},[n("i",{staticClass:"fal fa-ellipsis-h",attrs:{"data-fa-transform":"grow-20"}})]):t._e()]),!0===t.seedtab?n("div",{staticClass:"login"},["checkbox"===t.logintype?n("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],attrs:{placeholder:"Seed",id:"seed",name:"seed",type:"checkbox"},domProps:{checked:Array.isArray(t.seed)?t._i(t.seed,null)>-1:t.seed},on:{change:function(e){var n=t.seed,a=e.target,s=!!a.checked;if(Array.isArray(n)){var i=null,r=t._i(n,i);a.checked?r<0&&(t.seed=n.concat([i])):r>-1&&(t.seed=n.slice(0,r).concat(n.slice(r+1)))}else t.seed=s}}}):"radio"===t.logintype?n("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],attrs:{placeholder:"Seed",id:"seed",name:"seed",type:"radio"},domProps:{checked:t._q(t.seed,null)},on:{change:function(e){t.seed=null}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],attrs:{placeholder:"Seed",id:"seed",name:"seed",type:t.logintype},domProps:{value:t.seed},on:{input:function(e){e.target.composing||(t.seed=e.target.value)}}}),n("span",{staticClass:"eye",on:{click:t.togglevisibility}},[n("span",{class:{active:"password"===t.logintype}},[n("i",{staticClass:"far fa-eye"})]),n("span",{class:{active:"text"===t.logintype}},[n("i",{staticClass:"far fa-eye-slash"})])])]):t._e(),!1===t.seedtab?n("div",{staticClass:"login"},["checkbox"===t.logintype?n("input",{directives:[{name:"model",rawName:"v-model",value:t.key,expression:"key"}],attrs:{placeholder:"Private key",id:"key",name:"key",type:"checkbox"},domProps:{checked:Array.isArray(t.key)?t._i(t.key,null)>-1:t.key},on:{change:function(e){var n=t.key,a=e.target,s=!!a.checked;if(Array.isArray(n)){var i=null,r=t._i(n,i);a.checked?r<0&&(t.key=n.concat([i])):r>-1&&(t.key=n.slice(0,r).concat(n.slice(r+1)))}else t.key=s}}}):"radio"===t.logintype?n("input",{directives:[{name:"model",rawName:"v-model",value:t.key,expression:"key"}],attrs:{placeholder:"Private key",id:"key",name:"key",type:"radio"},domProps:{checked:t._q(t.key,null)},on:{change:function(e){t.key=null}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.key,expression:"key"}],attrs:{placeholder:"Private key",id:"key",name:"key",type:t.logintype},domProps:{value:t.key},on:{input:function(e){e.target.composing||(t.key=e.target.value)}}}),n("span",{staticClass:"eye",on:{click:t.togglevisibility}},[n("span",{class:{active:"password"===t.logintype}},[n("i",{staticClass:"far fa-eye"})]),n("span",{class:{active:"text"===t.logintype}},[n("i",{staticClass:"far fa-eye-slash"})])])]):t._e(),!0===t.showadvanced?n("div",[n("label",{attrs:{for:"seedindex"}},[t._v("Seed Index")]),n("div",{staticClass:"login"},["checkbox"===t.logintype?n("input",{directives:[{name:"model",rawName:"v-model",value:t.seedindex,expression:"seedindex"}],attrs:{id:"seedindex",name:"seedindex",type:"checkbox"},domProps:{checked:Array.isArray(t.seedindex)?t._i(t.seedindex,null)>-1:t.seedindex},on:{change:function(e){var n=t.seedindex,a=e.target,s=!!a.checked;if(Array.isArray(n)){var i=null,r=t._i(n,i);a.checked?r<0&&(t.seedindex=n.concat([i])):r>-1&&(t.seedindex=n.slice(0,r).concat(n.slice(r+1)))}else t.seedindex=s}}}):"radio"===t.logintype?n("input",{directives:[{name:"model",rawName:"v-model",value:t.seedindex,expression:"seedindex"}],attrs:{id:"seedindex",name:"seedindex",type:"radio"},domProps:{checked:t._q(t.seedindex,null)},on:{change:function(e){t.seedindex=null}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.seedindex,expression:"seedindex"}],attrs:{id:"seedindex",name:"seedindex",type:t.logintype},domProps:{value:t.seedindex},on:{input:function(e){e.target.composing||(t.seedindex=e.target.value)}}})])]):t._e(),n("button",{staticClass:"openwallet btn",attrs:{type:"button"},on:{click:t.openWallet}},[t._v("Open Wallet")]),n("scan-qr",{on:{scanned:t.scanDone}}),!1!==t.nfcsup?n("scan-nfc",{on:{scanned:t.scanDone}}):t._e()],1),n("div",{attrs:{id:"buttons"}},[n("router-link",{staticClass:"genwallet",attrs:{to:t.$store.getters["app/nodeLink"]+"generate"}},[t._v("Generate Wallet")])],1)]),n("div",{staticClass:"page",class:{active:!0===t.open},attrs:{id:"wallet"}},[n("div",{attrs:{id:"powstatus"}},[n("div",{staticClass:"status busy",class:{active:!1===t.ready}},[t._v("Calculating Work "),n("i",{staticClass:"fas fa-spinner fa-spin"})]),n("div",{staticClass:"status ready",class:{active:!0===t.ready}},[t._v("Ready "),n("i",{staticClass:"fas fa-check"})])]),n("div",{staticClass:"inner"},[n("div",{staticClass:"block"},[n("div",{staticClass:"headingtitle top"},[n("span",{attrs:{id:"closewallet"},on:{click:t.logout}},[n("i",{staticClass:"fal fa-sign-out fa-flip-horizontal"})]),n("span",[t._v("Wallet")]),n("span",{staticClass:"refresh rotate",class:{down:t.isActive},on:{click:t.refresh}},[n("i",{staticClass:"fal fa-sync"})]),n("div",{staticClass:"lastrefresh"},[t._v("Last Refresh: "+t._s(t.lastrefresh.toLocaleTimeString()))])]),n("simplebar",{staticClass:"block pending"},[n("div",{attrs:{id:"output"}},[n("div",{staticClass:"balance"},[n("div",{staticClass:"raw",class:{active:t.balanceextra},on:{click:function(e){return t.copyToClipboard(t.address)}}},[t._v(t._s(t.address))]),n("div",{staticClass:"value",domProps:{innerHTML:t._s(t.abbreviateNumber(t.balance))}}),n("div",{staticClass:"raw",class:{active:t.balanceextra}},[t._v(t._s(t.balance))]),n("a",{staticClass:"balanceextra",attrs:{href:""},on:{click:function(e){e.preventDefault(),t.balanceextra=!t.balanceextra}}},[n("i",{staticClass:"fal fa-ellipsis-h",attrs:{"data-fa-transform":"grow-20"}})])])]),n("div",{staticClass:"headingtitle showmobile"},[t._v("History")]),t._l(t.pending,(function(e,a){return n("transaction",{key:a,attrs:{index:a,transaction:e,type:"pending"},on:{blockdetails:function(e){t.blockdetails=e},receive:t.refreshDetails}})}))],2)],1),n("simplebar",{staticClass:"block history"},[n("div",{staticClass:"headingtitle hidemobile"},[t._v("History")]),t._l(t.history,(function(e,a){return n("transaction",{key:a,attrs:{index:a,transaction:e,type:e.type},on:{blockdetails:function(e){t.blockdetails=e}}})}))],2)],1),n("div",{staticClass:"menu",attrs:{id:"walletmenu"}},[n("div",{staticClass:"bg"}),n("div",{staticClass:"content"},[n("div",{staticClass:"tab",attrs:{"data-tab":"#receive"},on:{click:function(e){t.receive=!0}}},[t._m(0),n("span",[t._v("Receive")])]),n("div",{staticClass:"tab",attrs:{"data-tab":"#send"},on:{click:function(e){t.send=!0}}},[t._m(1),n("span",[t._v("Send")])]),n("div",{staticClass:"tab",attrs:{"data-tab":"#settings"},on:{click:function(e){t.settings=!0}}},[t._m(2),n("span",[t._v("Settings")])])])])]),n("div",{staticClass:"page",class:{active:!1!==t.send},attrs:{id:"send"}},[!0===t.closebutton?n("a",{staticClass:"close",on:{click:function(e){t.send=!1}}},[n("i",{staticClass:"fal fa-times"})]):t._e(),n("send",{attrs:{open:t.send},on:{close:function(e){t.send=!1}}})],1),n("div",{staticClass:"page",class:{active:!1!==t.settings},attrs:{id:"settings"}},[!0===t.closebutton?n("a",{staticClass:"close",on:{click:function(e){t.settings=!1}}},[n("i",{staticClass:"fal fa-times"})]):t._e(),n("settings",{attrs:{open:t.settings,representative:t.representative},on:{change:t.repChange}})],1),n("div",{staticClass:"page",class:{active:!1!==t.receive},attrs:{id:"receive"}},[!0===t.closebutton?n("a",{staticClass:"close",on:{click:function(e){t.receive=!1}}},[n("i",{staticClass:"fal fa-times"})]):t._e(),n("receive",{attrs:{address:t.address}})],1),n("div",{staticClass:"page",class:{active:null!==t.blockdetails},attrs:{id:"blockdetails"}},[!0===t.closebutton?n("a",{staticClass:"close",on:{click:function(e){t.blockdetails=null}}},[n("i",{staticClass:"fal fa-times"})]):t._e(),n("block-state",{attrs:{details:t.blockdetails}})],1)])},m=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"menuicon"},[n("i",{staticClass:"fal fa-wallet",attrs:{"data-fa-transform":"grow-8"}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"menuicon"},[n("i",{staticClass:"fal fa-coins",attrs:{"data-fa-transform":"grow-8"}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"menuicon"},[n("i",{staticClass:"fal fa-cog",attrs:{"data-fa-transform":"grow-8"}})])}],b=(n("c975"),n("b0c0"),n("b64b"),n("ac1f"),n("5319"),n("2ca0"),n("b85c")),g=(n("96cf"),n("1da1")),k=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"transaction",class:t.type},[n("div",{staticClass:"type icon",attrs:{value:t.hash},on:{click:function(e){return t.$emit("blockdetails",t.hash)}}},["send"===t.type?n("i",{staticClass:"fal fa-minus-circle"}):"pending"===t.type?n("i",{staticClass:"fal fa-exclamation-circle"}):n("i",{staticClass:"fal fa-plus-circle"})]),n("div",{staticClass:"innerdetails"},[n("div",{staticClass:"amount"},[n("div",{staticClass:"value",attrs:{title:t.rawValue},domProps:{innerHTML:t._s(t.formattedValue)}},[n("i",{staticClass:"fal fa-coin"})]),"pending"!==t.type?n("div",{staticClass:"type"},[t._v(t._s(t.transactionStatus(t.transaction.type)))]):t._e(),"pending"===t.type?n("div",{staticClass:"type"},[null!==t.privatekey?n("button",{staticClass:"pocket",on:{click:t.receive}},[t._v("Click to Receive")]):n("div",{},[t._v("Pending")])]):t._e()]),n("div",{staticClass:"address"},["pending"!==t.type?n("span",{domProps:{innerHTML:t._s(t.abbreviateAddress(t.transaction.account)+" "+t.formattedDate)},on:{click:function(e){return t.link("address",t.transaction.account)}}}):t._e(),"pending"===t.type?n("span",{domProps:{innerHTML:t._s(t.abbreviateAddress(t.transaction.source))},on:{click:function(e){return t.link("address",t.transaction.source)}}}):t._e()])])])},y=[],w=(n("a9e3"),n("b680"),n("174c")),x=(n("fb6a"),n("8722")),C=n("174c"),_={data:function(){return{rawconv:{from:"raw",to:"Nano"},nanoconv:{from:"Nano",to:"raw"}}},computed:{},mounted:function(){},methods:{abbreviateNumber:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return console.log(t),2===e?t<.005?t:x(t).format({trimMantissa:!0,mantissa:2,average:!0}):x(t).format({trimMantissa:!0,mantissa:10,average:!0})},copyToClipboard:function(t){var e=document.createElement("textarea");e.innerHTML=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),r["default"].notify({title:"Success!",text:"Copied to clipboard",type:"success"})},link:function(t,e){var n=window.location.origin;"address"==t&&window.open(n+"/#"+this.$store.getters["app/nodeLink"]+"address/"+e),"block"==t&&window.open(n+"/#"+this.$store.getters["app/nodeLink"]+"block/"+e)},abbreviateAddress:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";return!0===e&&(n+='<span class="abbreviate">'),n+=t.substring(0,11)+"..."+t.slice(t.length-6),!0===e&&(n+="</span>"),n},highlightAddress:function(t){if(null!==t&&void 0!==t){var e=t.length-6;return'<span class="abbreviate"><span class="highlight">'+t.substring(0,11)+"</span>"+t.substring(11,e)+'<span class="highlight">'+t.slice(t.length-6)+"</span></span>"}return null},transactionStatus:function(t){return"send"===t?"Sent":"receive"===t?"Received":void 0},checkamount:function(t){return!!C.checkAmount(t)||(this.$notify({title:"Invalid amount",text:"Please ensure the amount selected is a valid",type:"error"}),!1)}}},S=n("901e"),T=n.n(S),A={name:"Transaction",props:{transaction:Object,type:String,index:[Number,String]},mixins:[_],computed:{rawValue:function(){return w["convert"](this.transaction.amount,this.rawconv)},formattedValue:function(){return("send"===this.transaction.type?"-":"+")+this.abbreviateNumber(w["convert"](this.transaction.amount,this.rawconv),5)},formattedDate:function(){var t=new Date(1e3*this.transaction.local_timestamp);return t.getDate()+" "+t.toLocaleString("default",{month:"short"})+" "+t.getFullYear()},pow:function(){return this.$store.state.app.pow},ready:function(){return this.$store.state.app.ready},privatekey:function(){return this.$store.state.app.privatekey},hash:function(){return"pending"===this.type?this.index:this.transaction.hash}},methods:{receive:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n,a,s,i,r,o,c,l,u,d,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return null===t.pow&&t.$notify({title:"PoW not complete",text:"Please wait for the status to be ready",type:"error"}),n=w["derivePublicKey"](t.privatekey),a=w["deriveAddress"](n,{useNanoPrefix:!0}),s={},s["action"]="account_info",s["representative"]="true",s["account"]=a,e.next=9,t.$store.dispatch("app/rpCall",s);case 9:return i=e.sent,r="0",o="open",c="0000000000000000000000000000000000000000000000000000000000000000",l=a,"balance"in i&&(r=i.balance,o="receive",c=i.frontier,l=i.representative),u=new T.a(r).plus(new T.a(t.transaction.amount)).toFixed(),d=w["createBlock"](t.privatekey,{work:t.pow,previous:c,representative:l,balance:u,link:t.index}),p={},p["action"]="process",p["json_block"]="true",p["subtype"]=o,p["block"]=d.block,e.next=24,t.$store.dispatch("app/rpCall",p);case 24:t.$emit("receive",!0);case 25:case"end":return e.stop()}}),e)})))()}}},R=A,$=Object(d["a"])(R,k,y,!1,null,"f4aa3dc0",null),O=$.exports,j=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"send"},[n("div",{attrs:{id:"sendform"}},[n("label",{attrs:{for:"amount"}},[t._v("Amount:")]),n("div",{staticClass:"login"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"amount"}],attrs:{type:"text",id:"amount",name:"amount"},domProps:{value:t.amount},on:{input:function(e){e.target.composing||(t.amount=e.target.value)}}}),n("span",{staticClass:"max",on:{click:t.setmax}},[t._v("MAX")])]),n("label",{attrs:{for:"destination"}},[t._v("Destination:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.destination,expression:"destination"}],attrs:{type:"text",id:"destination",name:"destination"},domProps:{value:t.destination},on:{input:function(e){e.target.composing||(t.destination=e.target.value)}}})]),n("scan-qr",{on:{scanned:t.scanDone}}),!1!==t.nfcsup?n("scan-nfc",{on:{scanned:t.scanDone}}):t._e(),n("button",{staticClass:"sendfunds btn",attrs:{type:"button"},on:{click:t.send}},[t._v("Send")])],1)},E=[],N=(n("4160"),n("1276"),n("159b"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"scan-qr-code"},[n("button",{staticClass:"scan btn outline",attrs:{type:"button"},on:{click:t.scanQR}},[t._v("Scan QR")]),n("div",{staticClass:"page",class:{active:!1!==t.scan},staticStyle:{"z-index":"9"}},[n("a",{staticClass:"close",on:{click:t.closeScan}},[n("i",{staticClass:"fal fa-times"})]),t.loadingMsg?n("div",[t._v(t._s(t.loadingMsg))]):t._e(),n("canvas",{attrs:{id:"scan_"+t._uid}})])])}),P=[],B=n("ecec"),D=n.n(B),F=document.createElement("video"),I={name:"ScanQr",props:{},data:function(){return{amount:"",destination:"",scan:!1,scanner:null,canvas:null,stream:null,continue:!0,loadingMsg:"Unable to access video stream (please make sure you have a webcam enabled)"}},methods:{closeScan:function(){F.srcObject&&F.srcObject.getTracks().forEach((function(t){t.stop()})),this.scan=!1,this.continue=!1},scanQR:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n,a,s,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=function(){if(a.loadingMsg="Loading video...",F.readyState===F.HAVE_ENOUGH_DATA){a.loadingMsg=null,n.height=F.videoHeight,n.width=F.videoWidth,a.canvas.drawImage(F,0,0,n.width,n.height);var t=a.canvas.getImageData(0,0,n.width,n.height),e=D()(t.data,t.width,t.height,{inversionAttempts:"dontInvert"});e&&(s(e.location.topLeftCorner,e.location.topRightCorner,"#0cd21a"),s(e.location.topRightCorner,e.location.bottomRightCorner,"#0cd21a"),s(e.location.bottomRightCorner,e.location.bottomLeftCorner,"#0cd21a"),s(e.location.bottomLeftCorner,e.location.topLeftCorner,"#0cd21a"),a.$emit("scanned",e.data),F.srcObject.getTracks().forEach((function(t){t.stop()})),a.continue=!1,setTimeout((function(){a.scan=!1}),1200))}!0===a.continue&&requestAnimationFrame(i)},s=function(t,e,n){a.canvas.beginPath(),a.canvas.moveTo(t.x,t.y),a.canvas.lineTo(e.x,e.y),a.canvas.lineWidth=4,a.canvas.strokeStyle=n,a.canvas.stroke()},t.scan=!0,t.continue=!0,n=document.getElementById("scan_"+t._uid),t.canvas=n.getContext("2d"),a=t,navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then((function(t){F.srcObject=t,F.setAttribute("playsinline",!0),F.play(),requestAnimationFrame(i)}));case 8:case"end":return e.stop()}}),e)})))()}}},L=I,M=Object(d["a"])(L,N,P,!1,null,null,null),W=M.exports,G=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"scan-nfc-code"},[n("button",{staticClass:"scan btn outline",attrs:{type:"button"},on:{click:t.scanNfc}},[t._v("Scan NFC")]),n("div",{staticClass:"page",class:{active:!1!==t.scannfc},staticStyle:{"z-index":"9"}},[n("a",{staticClass:"close",on:{click:t.closeScan}},[n("i",{staticClass:"fal fa-times"})]),"Scanning"===t.output?n("div",[t._v(t._s(t.output)+" "),n("i",{staticClass:"fas fa-spinner fa-spin"})]):n("div",[t._v(t._s(t.output))])])])},H=[],U={name:"ScanNfc",props:{},data:function(){return{output:"Checking for Web NFC Support",scannfc:!1,reader:null}},methods:{closeScan:function(){this.scannfc=!1,null!==this.reader&&this.reader.stop()},scanNfc:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.scannfc=!0,n=t,e.prev=2,n.reader=new NDEFReader,e.next=6,n.reader.scan();case 6:n.output="Scanning",n.reader.addEventListener("error",(function(t){n.output=t.message})),n.reader.onreading=function(t){var e,a=t.message,s=Object(b["a"])(a.records);try{for(s.s();!(e=s.n()).done;){var i=e.value;switch(i.recordType){case"text":var r=new TextDecoder(i.encoding),o=r.decode(i.data);n.$emit("scanned",o),n.closeScan();break;default:n.output="only text NDEF records are supported for scanning"}}}catch(c){s.e(c)}finally{s.f()}},e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](2),n.output=e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,11]])})))()}}},V=U,q=Object(d["a"])(V,G,H,!1,null,null,null),K=q.exports,J={name:"Send",mixins:[_],components:{ScanQr:W,ScanNfc:K},props:{address:String,open:Boolean},data:function(){return{amount:"",destination:"",nfcsup:!1}},computed:{pow:function(){return this.$store.state.app.pow},ready:function(){return this.$store.state.app.ready},privatekey:function(){return this.$store.state.app.privatekey}},watch:{open:function(t,e){!0===t&&!1===e&&(this.amount="",this.destination="")}},mounted:function(){"NDEFReader"in window&&(this.nfcsup=!0)},methods:{scanDone:function(t){this.amount="",this.destination="";var e=t.replace("nano:","").split("?");this.destination=e[0],e[1]&&e[1].split("&").forEach((function(t){var e=t.split("=");if("amount"==e[0]&&e[1]){var n=w["convert"](e[1],this.rawconv);this.checkamount(e[1])&&(this.amount=n)}}),this)},send:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n,a,s,i,r,o,c,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===t.pow&&t.$notify({title:"PoW not complete",text:"Please wait for the status to be ready",type:"error"}),t.amount.startsWith(".")&&(t.amount="0"+t.amount),n=w["convert"](t.amount,t.nanoconv),!t.checkamount(n)||!w["checkAddress"](t.destination)){e.next=29;break}return a=w["derivePublicKey"](t.privatekey),s=w["deriveAddress"](a,{useNanoPrefix:!0}),i={},i["action"]="account_info",i["representative"]="true",i["account"]=s,e.next=12,t.$store.dispatch("app/rpCall",i);case 12:return r=e.sent,o=new T.a(r.balance).minus(new T.a(n)).toFixed(),c=w["createBlock"](t.privatekey,{work:t.pow,previous:r.frontier,representative:r.representative,balance:o,link:t.destination}),console.log(c),l={},l["action"]="process",l["json_block"]="true",l["subtype"]="send",l["block"]=c.block,e.next=23,t.$store.dispatch("app/rpCall",l);case 23:t.$store.commit("app/pow",null),t.amount="",t.destination="",t.$emit("close","true"),e.next=30;break;case 29:w["checkAddress"](t.destination)||t.$notify({title:"Destination address is not valid",text:"Please use a valid address",type:"error"});case 30:case"end":return e.stop()}}),e)})))()},setmax:function(){this.amount=this.$store.state.app.balance}}},Q=J,Y=Object(d["a"])(Q,j,E,!1,null,null,null),z=Y.exports,X=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"receive inner"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!1===t.showset,expression:"showset === false"}],staticClass:"block"},[n("div",{staticClass:"address",domProps:{innerHTML:t._s(t.highlightAddress(t.address))},on:{click:function(e){return t.link("address",t.address)}}}),n("qr-block",{attrs:{address:t.receive}}),!0===t.set?n("div",{staticClass:"receive-amount"},[t._v("Amount: "+t._s(t.amount))]):t._e(),!0===t.clipboard?n("a",{staticClass:"btn",on:{click:function(e){return e.preventDefault(),t.copyToClipboard(t.address)}}},[t._v("Copy Address")]):t._e(),n("a",{staticClass:"btn outline",on:{click:function(e){return e.preventDefault(),t.setAmount()}}},[t._v("Set Amount")]),n("a",{staticClass:"btn outline",on:{click:function(e){return e.preventDefault(),t.clearReceive()}}},[t._v("Clear Amount")])],1),n("div",{directives:[{name:"show",rawName:"v-show",value:!1!==t.showset,expression:"showset !== false"}],staticClass:"block",staticStyle:{padding:"0","margin-top":"-47px"}},[n("div",{staticClass:"amount"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"amount"}],ref:"amount",attrs:{type:"text"},domProps:{value:t.amount},on:{keypress:function(e){return t.isNumber(e)},paste:function(e){return t.isNumber(e)},input:function(e){e.target.composing||(t.amount=e.target.value)}}})]),n("div",{staticClass:"keypad"},[n("div",{staticClass:"row"},[n("button",{on:{click:function(e){return t.addNumber("7")}}},[t._v("7")]),n("button",{on:{click:function(e){return t.addNumber("8")}}},[t._v("8")]),n("button",{on:{click:function(e){return t.addNumber("9")}}},[t._v("9")])]),n("div",{staticClass:"row"},[n("button",{on:{click:function(e){return t.addNumber("4")}}},[t._v("4")]),n("button",{on:{click:function(e){return t.addNumber("5")}}},[t._v("5")]),n("button",{on:{click:function(e){return t.addNumber("6")}}},[t._v("6")])]),n("div",{staticClass:"row"},[n("button",{on:{click:function(e){return t.addNumber("1")}}},[t._v("1")]),n("button",{on:{click:function(e){return t.addNumber("2")}}},[t._v("2")]),n("button",{on:{click:function(e){return t.addNumber("3")}}},[t._v("3")])]),n("div",{staticClass:"row"},[n("button",{on:{click:function(e){return t.backspace()}}},[n("i",{staticClass:"fal fa-backspace"})]),n("button",{on:{click:function(e){return t.addNumber("0")}}},[t._v("0")]),n("button",{on:{click:function(e){return t.addNumber(".")}}},[t._v(".")])])]),n("a",{staticClass:"btn",on:{click:function(e){return e.preventDefault(),t.setReceive()}}},[t._v("Receive")]),n("a",{staticClass:"btn outline",on:{click:function(e){return e.preventDefault(),t.cancel()}}},[t._v("Cancel")])])])},Z=[],tt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"qrcode",attrs:{id:t._uid}})},et=[],nt=n("6ffa"),at=n.n(nt),st={name:"QrBlock",props:{address:String},data:function(){return{}},watch:{address:function(t){if(null!==t){var e=new at.a({width:512,height:512,data:t,image:"qr_logo.png",dotsOptions:{type:"rounded"},imageOptions:{hideBackgroundDots:!1},qrOptions:{}});document.getElementById(this._uid).innerHTML="",e.append(document.getElementById(this._uid))}}},methods:{}},it=st,rt=(n("ae55"),Object(d["a"])(it,tt,et,!1,null,null,null)),ot=rt.exports,ct={name:"Receive",mixins:[_],components:{QrBlock:ot},props:{address:String},data:function(){return{newrep:"",amount:"0",set:!1,showset:!1,receive:null,clipboard:!0,pendingpoll:null}},watch:{address:function(t){this.receive="nano:"+t,this.$store.dispatch("app/pending",this.address)},showset:function(t){!0===t&&this.$nextTick((function(){this.$refs.amount.focus()}))},receive:function(){if("POS"==this.$route.name&&"0"!==this.amount){var t,e,n,a,s=this;this.pendingpoll=setInterval(Object(g["a"])(regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return"POS"==s.$route.name&&s.amount<="0"&&(s.amount="0",s.setReceive(),clearInterval(s.pendingpoll)),t=s.pending,i.next=4,s.$store.dispatch("app/pending",s.address);case 4:s.$nextTick((function(){if(e=s.pending,JSON.stringify(t)!==JSON.stringify(e)){n=Object.keys(t),a=Object.keys(e);var i,r=Object(b["a"])(a);try{for(r.s();!(i=r.n()).done;){var o=i.value;if(-1===n.indexOf(o)){var c=w["convert"](e[o].amount,s.rawconv);c>s.amount?s.amount="0":s.amount=new T.a(s.amount).minus(new T.a(c)).toFixed(),s.setReceive(),s.$notify({title:"Funds delivered: "+c,text:"Sent from "+s.abbreviateAddress(e[o].source,!1),type:"success"}),"0"!==s.amount&&clearInterval(s.pendingpoll)}}}catch(l){r.e(l)}finally{r.f()}}}));case 5:case"end":return i.stop()}}),i)}))),this.$store.state.app.settings.receiveinterval)}else clearInterval(this.pendingpoll)}},computed:{pending:function(){return this.$store.state.app.pending}},beforeDestroy:function(){clearInterval(this.pendingpoll)},methods:{isNumber:function(t){console.log(t);var e=t.which?t.which:t.keyCode;if(46==e){if(console.log(this.amount.indexOf(".")),-1===this.amount.indexOf("."))return!0;t.preventDefault()}else e>31&&(e<48||e>57)&&t.preventDefault();return"0"===t.key&&"0"===this.amount&&t.preventDefault(),"0"!==t.key&&"0"===this.amount&&(this.amount=t.key,t.preventDefault()),!0},setAmount:function(){this.showset=!0},addNumber:function(t){if("0"===this.amount&&"."!==t)return this.amount=t,void this.$refs.amount.focus();"."!==t||-1===this.amount.indexOf(".")?(this.amount=this.amount+t,this.$refs.amount.focus()):this.$refs.amount.focus()},backspace:function(){var t=this.amount.slice(0,-1);t.length<=0&&(t="0"),this.amount=t,this.$refs.amount.focus()},cancel:function(){this.amount="0",this.receive="nano:"+this.address,this.set=!1,this.showset=!1},setReceive:function(){if("0"===this.amount)return this.receive="nano:"+this.address,this.set=!1,this.showset=!1,!1;var t=w["convert"](this.amount,this.nanoconv);return!!this.checkamount(t)&&(this.receive="nano:"+this.address+"?amount="+t,this.set=!0,this.showset=!1,!0)},clearReceive:function(){this.receive="nano:"+this.address,this.set=!1,this.showset=!1,this.amount="0"}},mounted:function(){"POS"==this.$route.name&&(this.closebutton=!1,this.amount="0",this.clipboard=!1)}},lt=ct,ut=Object(d["a"])(lt,X,Z,!1,null,null,null),dt=ut.exports,pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"settings inner"},[n("div",{staticClass:"block"},[n("div",{staticClass:"details"},[n("label",{attrs:{for:"representative"}},[t._v("Current Representative")]),n("a",{staticClass:"copy",attrs:{href:"#"},on:{click:function(e){return t.copyToClipboard(t.representative)}}},[n("i",{staticClass:"fad fa-clone"})]),n("div",{staticClass:"address",staticStyle:{"margin-bottom":"30px",background:"#00000014",padding:"4px 14px"},domProps:{innerHTML:t._s(t.highlightAddress(t.representative))}})]),t.change?n("div",{staticClass:"details"},[null!==t.error?n("div",{staticClass:"error"},[t._v(t._s(t.error))]):t._e(),n("label",{attrs:{for:"newrep"}},[t._v("Change Representative")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.newrep,expression:"newrep"}],staticClass:"newrep",attrs:{type:"text",name:"newrep"},domProps:{value:t.newrep},on:{input:function(e){e.target.composing||(t.newrep=e.target.value)}}})]):t._e(),t.change?n("scan-qr",{on:{scanned:t.scanDone}}):t._e(),!1!==t.nfcsup?n("scan-nfc",{staticStyle:{"margin-bottom":"15px"},on:{scanned:t.scanDone}}):t._e(),n("div",{staticClass:"inline-buttons"},[t.change?t._e():n("button",{staticClass:"repchange btn",on:{click:function(e){t.change=!0}}},[t._v("Change Representative")]),t.change?n("button",{staticClass:"repchange btn",on:{click:t.changeRep}},[t._v("Confirm")]):t._e(),t.change?n("button",{staticClass:"repchange btn outline",on:{click:function(e){t.change=!1}}},[t._v("Cancel")]):t._e()])],1)])},vt=[],ft={name:"Settings",components:{ScanQr:W,ScanNfc:K},props:{representative:String,open:Boolean},mixins:[_],data:function(){return{newrep:"",change:!1,error:null,nfcsup:!1}},computed:{pow:function(){return this.$store.state.app.pow},privatekey:function(){return this.$store.state.app.privatekey}},watch:{open:function(t,e){!1===t&&!0===e&&(this.newrep="",this.change=!1,this.error=null)}},mounted:function(){"NDEFReader"in window&&(this.nfcsup=!0)},methods:{changeRep:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n,a,s,i,r,o,c,l,u;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===t.pow&&t.$notify({title:"PoW not complete",text:"Please wait for the status to be ready",type:"error"}),!w["checkAddress"](t.newrep)){e.next=25;break}return n=w["derivePublicKey"](t.privatekey),a=w["deriveAddress"](n,{useNanoPrefix:!0}),s={},s["action"]="account_info",s["representative"]="true",s["account"]=a,e.next=10,t.$store.dispatch("app/rpCall",s);case 10:return i=e.sent,r="change",o=i.frontier,c=i.balance,l=w["createBlock"](t.privatekey,{work:t.pow,previous:o,representative:t.newrep,balance:c,link:"0000000000000000000000000000000000000000000000000000000000000000"}),u={},u["action"]="process",u["json_block"]="true",u["subtype"]=r,u["block"]=l.block,e.next=22,t.$store.dispatch("app/rpCall",u);case 22:t.$emit("change",!0),e.next=26;break;case 25:t.error="Invalid Representative "+t.newrep;case 26:case"end":return e.stop()}}),e)})))()},scanDone:function(t){this.error=null;var e=t.replace("nanorep:","").split("?")[0];w["checkAddress"](e)?this.newrep=e:this.error="Invalid QR Data "+t}}},ht=ft,mt=Object(d["a"])(ht,pt,vt,!1,null,null,null),bt=mt.exports,gt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return null!==t.blockstate?n("simplebar",{attrs:{id:"breakdown"}},[n("header",{staticClass:"headingtitle"},[t._v("State Block "),n("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.hash)}}},[n("i",{staticClass:"fad fa-clone"})]),n("span",{staticClass:"value",on:{click:function(e){return t.link("block",t.hash)}}},[n("i",{staticClass:"fad fa-external-link"})])]),n("div",{staticClass:"stateblock block"},[t._v(t._s(t.hash))]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Block subtype "),n("span",{staticClass:"subtype value"},[t._v(t._s(t.blockstate.subtype))])]),n("div",{staticClass:"label"},[t._v("The type of transaction that created this state block")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Account "),n("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.blockstate.contents.account)}}},[n("i",{staticClass:"fad fa-clone"})]),n("span",{staticClass:"value",on:{click:function(e){return t.link("address",t.blockstate.contents.account)}}},[n("i",{staticClass:"fad fa-external-link"})])]),n("div",{staticClass:"account"},[t._v(t._s(t.blockstate.contents.account))]),n("div",{staticClass:"label"},[t._v("The account represented by this state block")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Amount "),n("span",{staticClass:"amount value",domProps:{innerHTML:t._s(t.formattedValue(t.blockstate.amount))}})]),n("div",{staticClass:"raw"},[n("span",{staticClass:"amount_raw"},[t._v(t._s(t.blockstate.amount))]),t._v(" raw")]),n("div",{staticClass:"label"},[t._v("The amount of NANO that was sent in this transaction")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Balance "),n("span",{staticClass:"balance value",domProps:{innerHTML:t._s(t.formattedValue(t.blockstate.balance))}})]),n("div",{staticClass:"raw"},[n("span",{staticClass:"balance_raw"},[t._v(t._s(t.blockstate.balance))]),t._v(" raw")]),n("div",{staticClass:"label"},[t._v("The amount of NANO that was sent in this transaction")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Representative "),n("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.blockstate.contents.representative)}}},[n("i",{staticClass:"fad fa-clone"})]),n("span",{staticClass:"value",on:{click:function(e){return t.link("address",t.blockstate.contents.representative)}}},[n("i",{staticClass:"fad fa-external-link"})])]),n("div",[n("span",{staticClass:"rep_raw"},[t._v(t._s(t.blockstate.contents.representative))])]),n("div",{staticClass:"label"},[t._v("The account's representative")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Recipient "),n("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.blockstate.contents.representative)}}},[n("i",{staticClass:"fad fa-clone"})]),t._v(" "),n("span",{staticClass:"value",on:{click:function(e){return t.link("address",t.blockstate.contents.link_as_account)}}},[n("i",{staticClass:"fad fa-external-link"})])]),n("div",[n("span",{staticClass:"rec_raw"},[t._v(t._s(t.blockstate.contents.link_as_account))])]),n("div",{staticClass:"label"},[t._v("The account that is receiving the transaction")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Date "),n("span",{staticClass:"value"},[t._v(t._s(t.formattedDate))])]),n("div",{staticClass:"label"},[t._v("The date and time this block was discovered (converted to your local time)")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Previous Block "),n("span",{staticClass:"value",on:{click:function(e){return t.link("block",t.blockstate.contents.previous)}}},[n("i",{staticClass:"fad fa-external-link"})])]),n("div",[t._v(" "+t._s(t.blockstate.contents.previous)+" ")]),n("div",{staticClass:"label"},[t._v("The previous block in this account's chain")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Link")]),n("div",[t._v(t._s(t.blockstate.contents.link))]),n("div",{staticClass:"label"},[t._v("The destination address encoded in hex format or the block hash if open")])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Proof of Work")]),n("div",[t._v(t._s(t.blockstate.contents.work))])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("Signature")]),n("div",[t._v(t._s(t.blockstate.contents.signature))])]),n("div",{staticClass:"block"},[n("div",{staticClass:"title"},[t._v("JSON "),n("span",{staticClass:"value",on:{click:function(e){t.copyToClipboard(JSON.stringify(t.blockstate))}}},[n("i",{staticClass:"fad fa-clone"})])]),n("div",{staticClass:"json"},[n("pre",[t._v(t._s(JSON.stringify(t.blockstate,null,4)))])])])]):t._e()},kt=[],yt=n("8d3b"),wt=(n("f138"),{name:"BlockState",components:{simplebar:yt["a"]},props:{details:{default:null,type:String},static:{default:!1,type:Boolean}},mixins:[_],data:function(){return{hash:null,blockstate:null}},mounted:function(){this.static&&this.getDetails(this.$route.params.hash)},watch:{details:function(t){var e=this;return Object(g["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:null!==t?e.getDetails(t):e.blockstate=null;case 1:case"end":return n.stop()}}),n)})))()}},methods:{getDetails:function(t){var e=this;return Object(g["a"])(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a={action:"block_info",json_block:"true",hash:t},e.hash=t,n.next=4,e.$store.dispatch("app/rpCall",a);case 4:e.blockstate=n.sent;case 5:case"end":return n.stop()}}),n)})))()},formattedValue:function(t){return this.abbreviateNumber(w["convert"](t,this.rawconv),5)}},computed:{formattedDate:function(){var t=new Date(1e3*this.blockstate.local_timestamp);return t.getDate()+" "+t.toLocaleString("default",{month:"short"})+" "+t.getFullYear()+" - "+t.toLocaleTimeString()}}}),xt=wt,Ct=(n("2dca"),Object(d["a"])(xt,gt,kt,!1,null,"51ce3523",null)),_t=Ct.exports;n("99af"),n("a630"),n("25f0"),n("3ca3"),n("cfc3"),n("5cc6"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7");function St(t,e,n){for(var a="",s=n-1;s>-1;s--)a+=(t[s]>15?"":"0")+t[s].toString(16);return a}function Tt(t){for(var e="",n=t.length;n>0;n-=2)e+=t.slice(n-2,n);return e}function At(t,e,n,a,s,i){var r=document.createElement("canvas");r.width=n,r.height=a;var o=r.getContext("webgl2");if(!o)throw new Error("webgl2_required");if(!/^[A-F-a-f0-9]{64}$/.test(t))throw new Error("invalid_hash");o.clearColor(0,0,0,1);var c=Tt(t),l="#version 300 es\n precision highp float;\n layout (location=0) in vec4 position;\n layout (location=1) in vec2 uv;\n\n out vec2 uv_pos;\n\n void main() {\n uv_pos = uv;\n gl_Position = position;\n }",u="#version 300 es\n precision highp float;\n precision highp int;\n\n in vec2 uv_pos;\n out vec4 fragColor;\n\n // Random work values\n // First 2 bytes will be overwritten by texture pixel position\n // Second 2 bytes will be modified if the canvas size is greater than 256x256\n uniform uvec4 u_work0;\n // Last 4 bytes remain as generated externally\n uniform uvec4 u_work1;\n\n // Defined separately from uint v[32] below as the original value is required\n // to calculate the second uint32 of the digest for threshold comparison\n #define BLAKE2B_IV32_1 0x6A09E667u\n\n // Both buffers represent 16 uint64s as 32 uint32s\n // because that's what GLSL offers, just like Javascript\n\n // Compression buffer, intialized to 2 instances of the initialization vector\n // The following values have been modified from the BLAKE2B_IV:\n // OUTLEN is constant 8 bytes\n // v[0] ^= 0x01010000u ^ uint(OUTLEN);\n // INLEN is constant 40 bytes: work value (8) + block hash (32)\n // v[24] ^= uint(INLEN);\n // It's always the \"last\" compression at this INLEN\n // v[28] = ~v[28];\n // v[29] = ~v[29];\n uint v[32] = uint[32](\n 0xF2BDC900u, 0x6A09E667u, 0x84CAA73Bu, 0xBB67AE85u,\n 0xFE94F82Bu, 0x3C6EF372u, 0x5F1D36F1u, 0xA54FF53Au,\n 0xADE682D1u, 0x510E527Fu, 0x2B3E6C1Fu, 0x9B05688Cu,\n 0xFB41BD6Bu, 0x1F83D9ABu, 0x137E2179u, 0x5BE0CD19u,\n 0xF3BCC908u, 0x6A09E667u, 0x84CAA73Bu, 0xBB67AE85u,\n 0xFE94F82Bu, 0x3C6EF372u, 0x5F1D36F1u, 0xA54FF53Au,\n 0xADE682F9u, 0x510E527Fu, 0x2B3E6C1Fu, 0x9B05688Cu,\n 0x04BE4294u, 0xE07C2654u, 0x137E2179u, 0x5BE0CD19u\n );\n // Input data buffer\n uint m[32];\n\n // These are offsets into the input data buffer for each mixing step.\n // They are multiplied by 2 from the original SIGMA values in\n // the C reference implementation, which refered to uint64s.\n const int SIGMA82[192] = int[192](\n 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,2,24,\n 0,4,22,14,10,6,22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8,14,18,6,2,26,\n 24,22,28,4,12,10,20,8,0,30,16,18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,\n 26,4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18,24,10,2,30,28,26,8,20,0,\n 14,12,6,18,4,16,22,26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20,12,30,28,\n 18,22,6,0,16,24,4,26,14,2,8,20,10,20,4,16,8,14,12,2,10,30,22,18,28,6,24,\n 26,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,\n 2,24,0,4,22,14,10,6\n );\n\n // 64-bit unsigned addition within the compression buffer\n // Sets v[a,a+1] += b\n // b0 is the low 32 bits of b, b1 represents the high 32 bits\n void add_uint64 (int a, uint b0, uint b1) {\n uint o0 = v[a] + b0;\n uint o1 = v[a + 1] + b1;\n if (v[a] > 0xFFFFFFFFu - b0) { // did low 32 bits overflow?\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n }\n // Sets v[a,a+1] += v[b,b+1]\n void add_uint64 (int a, int b) {\n add_uint64(a, v[b], v[b+1]);\n }\n\n // G Mixing function\n void B2B_G (int a, int b, int c, int d, int ix, int iy) {\n add_uint64(a, b);\n add_uint64(a, m[ix], m[ix + 1]);\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n uint xor0 = v[d] ^ v[a];\n uint xor1 = v[d + 1] ^ v[a + 1];\n v[d] = xor1;\n v[d + 1] = xor0;\n\n add_uint64(c, d);\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c];\n xor1 = v[b + 1] ^ v[c + 1];\n v[b] = (xor0 >> 24) ^ (xor1 << 8);\n v[b + 1] = (xor1 >> 24) ^ (xor0 << 8);\n\n add_uint64(a, b);\n add_uint64(a, m[iy], m[iy + 1]);\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a];\n xor1 = v[d + 1] ^ v[a + 1];\n v[d] = (xor0 >> 16) ^ (xor1 << 16);\n v[d + 1] = (xor1 >> 16) ^ (xor0 << 16);\n\n add_uint64(c, d);\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c];\n xor1 = v[b + 1] ^ v[c + 1];\n v[b] = (xor1 >> 31) ^ (xor0 << 1);\n v[b + 1] = (xor0 >> 31) ^ (xor1 << 1);\n }\n\n void main() {\n int i;\n uint uv_x = uint(uv_pos.x * ".concat(r.width-1,".);\n uint uv_y = uint(uv_pos.y * ").concat(r.height-1,".);\n uint x_pos = uv_x % 256u;\n uint y_pos = uv_y % 256u;\n uint x_index = (uv_x - x_pos) / 256u;\n uint y_index = (uv_y - y_pos) / 256u;\n\n // First 2 work bytes are the x,y pos within the 256x256 area, the next\n // two bytes are modified from the random generated value, XOR'd with\n // the x,y area index of where this pixel is located\n m[0] = (x_pos ^ (y_pos << 8) ^ ((u_work0.b ^ x_index) << 16) ^ ((u_work0.a ^ y_index) << 24));\n // Remaining bytes are un-modified from the random generated value\n m[1] = (u_work1.r ^ (u_work1.g << 8) ^ (u_work1.b << 16) ^ (u_work1.a << 24));\n\n // Block hash\n m[2] = 0x").concat(c.slice(56,64),"u;\n m[3] = 0x").concat(c.slice(48,56),"u;\n m[4] = 0x").concat(c.slice(40,48),"u;\n m[5] = 0x").concat(c.slice(32,40),"u;\n m[6] = 0x").concat(c.slice(24,32),"u;\n m[7] = 0x").concat(c.slice(16,24),"u;\n m[8] = 0x").concat(c.slice(8,16),"u;\n m[9] = 0x").concat(c.slice(0,8),"u;\n\n // twelve rounds of mixing\n for(i=0;i<12;i++) {\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]);\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]);\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]);\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]);\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]);\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]);\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]);\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]);\n }\n\n // Threshold test, first 4 bytes not significant,\n // only calculate digest of the second 4 bytes\n if((BLAKE2B_IV32_1 ^ v[1] ^ v[17]) > ")+e+"u) {\n // Success found, return pixel data so work value can be constructed\n fragColor = vec4(\n float(x_index + 1u)/255., // +1 to distinguish from 0 (unsuccessful) pixels\n float(y_index + 1u)/255., // Same as previous\n float(x_pos)/255., // Return the 2 custom bytes used in work value\n float(y_pos)/255. // Second custom byte\n );\n }\n }",d=o.createShader(o.VERTEX_SHADER);if(o.shaderSource(d,l),o.compileShader(d),!o.getShaderParameter(d,o.COMPILE_STATUS))throw o.getShaderInfoLog(d);var p=o.createShader(o.FRAGMENT_SHADER);if(o.shaderSource(p,u),o.compileShader(p),!o.getShaderParameter(p,o.COMPILE_STATUS))throw o.getShaderInfoLog(p);var v=o.createProgram();if(o.attachShader(v,d),o.attachShader(v,p),o.linkProgram(v),!o.getProgramParameter(v,o.LINK_STATUS))throw o.getProgramInfoLog(v);o.useProgram(v);var f=o.createVertexArray();o.bindVertexArray(f);var h=new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0,1,1,0,-1,-1,0]),m=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,h,o.STATIC_DRAW),o.vertexAttribPointer(0,3,o.FLOAT,!1,0,0),o.enableVertexAttribArray(0);var b=new Float32Array([1,1,1,0,0,0,0,1,0,0,1,1]),g=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,g),o.bufferData(o.ARRAY_BUFFER,b,o.STATIC_DRAW),o.vertexAttribPointer(1,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(1);var k=o.getUniformLocation(v,"u_work0"),y=o.getUniformLocation(v,"u_work1"),w=new Uint8Array(4),x=new Uint8Array(4),C=0;function _(){if(C++,window.crypto.getRandomValues(w),window.crypto.getRandomValues(x),o.uniform4uiv(k,Array.from(w)),o.uniform4uiv(y,Array.from(x)),C%100!==0||"function"!==typeof i||!i(C)){o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLES,0,6);var t=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,t);for(var e=0;e<t.length;e+=4)if(0!==t[e])return void("function"===typeof s&&s(St(x,0,4)+St([t[e+2],t[e+3],w[2]^t[e]-1,w[3]^t[e+1]-1],0,4),C));window.requestAnimationFrame(_)}}window.requestAnimationFrame(_)}var Rt=n("5ba3"),$t=n.n(Rt),Ot=window.navigator.hardwareConcurrency||2,jt=Math.max(Ot-1,1),Et=[];function Nt(){return{seed:null,seedindex:null,key:null,open:!1,details:{},error:null,balance:0,receive:!1,genwallet:!1,send:!1,settings:!1,representative:"",blockdetails:null,address:null,logintype:"password",walletdata:null,isActive:!1,balanceextra:!1,terminate:!1,showadvanced:!1,seedtab:!0,pendingpoll:null,lastrefresh:new Date,closebutton:!0,nfcsup:!1}}var Pt={name:"Home",components:{Transaction:O,Send:z,Receive:dt,Settings:bt,BlockState:_t,simplebar:yt["a"],ScanQr:W,ScanNfc:K},mixins:[_],data:function(){return Nt()},watch:{open:function(t){(!0===t&&null!==this.key||null!==this.seed)&&(console.log("open"),this.refreshDetails(!0))},pow:function(){var t=Object(g["a"])(regeneratorRuntime.mark((function t(e,n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:!0===this.open&&e!==n&&null===e&&(console.log("pow change"),this.refreshDetails());case 1:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}(),receive:function(t){if(!0===t&&"POS"!==this.$route.name){var e,n,a,s,i=this;this.pendingpoll=setInterval(Object(g["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=i.pending,t.next=3,i.$store.dispatch("app/pending",i.address);case 3:i.lastrefresh=new Date,i.$nextTick((function(){if(n=i.pending,JSON.stringify(e)!==JSON.stringify(n)){a=Object.keys(e),s=Object.keys(n);var t,r=Object(b["a"])(s);try{for(r.s();!(t=r.n()).done;){var o=t.value;-1===a.indexOf(o)&&i.$notify({title:"Funds delivered: "+w["convert"](n[o].amount,this.rawconv),text:"Sent from "+i.abbreviateAddress(n[o].source,!1),type:"success"})}}catch(c){r.e(c)}finally{r.f()}}}));case 5:case"end":return t.stop()}}),t)}))),1e4)}else clearInterval(this.pendingpoll)}},mounted:function(){"POS"==this.$route.name&&(this.address=this.$route.params.address,this.receive=!0,this.closebutton=!1),"NDEFReader"in window&&(this.nfcsup=!0),void 0===this.$store.state.app.node.address&&this.$router.push("node")},computed:{genWalletLink:function(){return"node"in this.$route.params?this.$route.params.node:""},loginicon:function(){return"password"===this.logintype?"fa-eye":"fa-eye-slash"},pow:function(){return this.$store.state.app.pow},ready:function(){return this.$store.state.app.ready},history:function(){return this.$store.state.app.history},pending:function(){return this.$store.state.app.pending},privatekey:function(){return this.$store.state.app.privatekey}},methods:{setSeed:function(){this.seedtab=!0},setPrivate:function(){this.seedtab=!1,this.showadvanced=!1},repChange:function(){this.refreshDetails(),this.settings=!1},scanDone:function(t){if(t.startsWith("nanokey:"))this.seedtab=!1,this.showadvanced=!1,this.key=t.replace("nanokey:","").substr(0,64),this.error=null;else if(t.startsWith("nanoseed:")){var e=t.replace("nanoseed:","").substr(0,64);this.seed=e,this.error=null}else this.error="QR code data does not conform to specification",this.seed=t},logout:function(){for(var t in Object.assign(this.$data,Nt()),this.$store.dispatch("app/resetState"),Et)console.log("Terminate: "+t),Et[t].terminate()},refresh:function(){this.isActive=!this.isActive,this.refreshDetails()},refreshDetails:function(){var t=arguments,e=this;return Object(g["a"])(regeneratorRuntime.mark((function n(){var a,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=t.length>0&&void 0!==t[0]&&t[0],s=null,"frontier"in e.details&&(s=e.details.frontier),n.prev=3,n.next=6,e.getDetails(e.privatekey);case 6:e.lastrefresh=new Date,s===e.details.frontier&&!0!==a||e.genWork(e.privatekey,e.details),e.$store.dispatch("app/history",e.address),e.$store.dispatch("app/pending",e.address),e.details.balance?(e.balance=w["convert"](e.details.balance,e.rawconv),e.$store.commit("app/balance",e.balance)):e.balance=0,e.representative=e.details.representative,n.next=18;break;case 14:n.prev=14,n.t0=n["catch"](3),e.error="Could not connect to RPC",e.open=!1;case 18:case"end":return n.stop()}}),n,null,[[3,14]])})))()},genWork:function(t,e){var n=this;return Object(g["a"])(regeneratorRuntime.mark((function a(){var s,i,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n.$store.commit("app/pow",null),n.$store.commit("app/ready",!1),"frontier"in e?(console.log("Frontier in details"),s=e.frontier):(console.log("Frontier NOT in details"),s=w["derivePublicKey"](t)),i=document.createElement("canvas").getContext("webgl2"),!i){a.next=9;break}console.log("Calculating pow for "+s+" using WebGL this may take some time"),At(s,"0xFFFFFFC0",2048,256,(function(t){n.$store.commit("app/pow",t),n.$store.commit("app/ready",!0)})),a.next=22;break;case 9:if(!window.Worker){a.next=16;break}return console.log("Calculating pow for "+s+" this may take some time"),r=function(){return new Promise((function(t){Et=[];for(var e=0;e<jt;e++){var a=new $t.a;a.postMessage({blockHash:s,workerIndex:e,workerCount:jt}),a.onmessage=function(e){for(var a in console.log("Work: "+e.data),n.$store.commit("app/pow",e.data),n.$store.commit("app/ready",!0),Et)console.log("Terminate: "+a),Et[a].terminate();t()},Et.push(a)}}))},a.next=14,r();case 14:a.next=22;break;case 16:return console.log("Calculating pow for "+s+" (no worker) this may take some time"),a.next=19,w["computeWork"](s);case 19:o=a.sent,n.$store.commit("app/pow",o),n.$store.commit("app/ready",!0);case 22:case"end":return a.stop()}}),a)})))()},togglevisibility:function(){console.log(this.logintype),this.logintype="password"===this.logintype?"text":"password"},getAddress:function(t){var e=w["derivePublicKey"](t);return w["deriveAddress"](e,{useNanoPrefix:!0})},getDetails:function(t){var e=this;return Object(g["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.address=e.getAddress(t),n.next=3,e.$store.dispatch("app/getDetails",e.address);case 3:e.details=n.sent;case 4:case"end":return n.stop()}}),n)})))()},openWallet:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.error=null,t.key)try{n=w["checkKey"](t.key),!1===n?t.error="Invalid key":(t.$store.commit("app/privatekey",t.key),t.open=!0)}catch(s){t.error=s}else if(t.seed)try{a=w["checkSeed"](t.seed),!1===a?t.error="Invalid Seed":(null==t.seedindex?t.seedindex=0:t.seedindex=parseInt(t.seedindex),t.key=w["deriveSecretKey"](t.seed,t.seedindex),t.$store.commit("app/privatekey",t.key),t.open=!0)}catch(s){t.error=s}case 2:case"end":return e.stop()}}),e)})))()}}},Bt=Pt,Dt=Object(d["a"])(Bt,h,m,!1,null,null,null),Ft=Dt.exports,It=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page active",staticStyle:{top:"0"},attrs:{id:"blockdetails"}},[n("block-state",{attrs:{static:!0}})],1)},Lt=[],Mt={name:"Block",components:{BlockState:_t},data:function(){return{blockdetails:null}},watch:{},mounted:function(){this.blockdetails=this.$route.params.hash}},Wt=Mt,Gt=Object(d["a"])(Wt,It,Lt,!1,null,null,null),Ht=Gt.exports,Ut=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page active",staticStyle:{top:"0"},attrs:{id:"blockdetails"}},[n("label",{attrs:{for:"key"}},[t._v("Enter node address")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.node,expression:"node"}],attrs:{type:"text",id:"node",name:"node"},domProps:{value:t.node},on:{input:function(e){e.target.composing||(t.node=e.target.value)}}}),n("button",{staticClass:"openwallet btn",attrs:{type:"button"},on:{click:t.openNode}},[t._v("Go To Node")]),n("p",[t._v("This wallet is designed to use any Nano Node RPC server as a backend, using nano.linuxserver.io will plug you into our own public network.")]),t._m(0),t._m(1),t._m(2)])},Vt=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",[t._v("If you are looking for the live Nano network please use "),n("a",{staticClass:"highlight",attrs:{href:"https://tixwallet.cc/",target:"_blank"}},[t._v("tixwallet.cc")]),t._v(".")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",[t._v("More information including how to get funds from a faucet is available on "),n("a",{staticClass:"highlight",attrs:{target:"_blank",href:"https://github.com/linuxserver/nano-wallet/"}},[t._v("GitHub")]),t._v(".")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",[n("a",{staticClass:"highlight",attrs:{target:"_blank",href:"https://github.com/linuxserver/nano-wallet/"}},[n("i",{staticClass:"fab fa-2x fa-github"})])])}],qt={name:"Block",components:{},data:function(){return{node:"nano.linuxserver.io"}},watch:{},methods:{openNode:function(){this.$router.push("/"+this.node)}}},Kt=qt,Jt=Object(d["a"])(Kt,Ut,Vt,!1,null,null,null),Qt=Jt.exports,Yt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page active",attrs:{id:"genwallet"}},[n("router-link",{staticClass:"close",attrs:{to:t.$store.getters["app/nodeLink"]}},[n("i",{staticClass:"fal fa-times"})]),n("div",{staticClass:"block"},[n("div",{staticClass:"details smaller"},[n("label",{attrs:{for:"seed"}},[t._v("Seed "),n("a",{staticClass:"refreshwallet",attrs:{href:""},on:{click:function(e){return e.preventDefault(),t.refreshWallet(e)}}},[n("i",{staticClass:"fal fa-sync"})])]),n("a",{staticClass:"copy",attrs:{href:"#"},on:{click:function(e){return t.copyToClipboard(t.seed)}}},[n("i",{staticClass:"fad fa-clone"})]),n("div",{staticClass:"login"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],staticClass:"copytext",attrs:{type:"text",name:"seed"},domProps:{value:t.seed},on:{input:function(e){e.target.composing||(t.seed=e.target.value)}}}),n("span",{staticClass:"max",on:{click:t.clearWallet}},[t._v("CLEAR")])])]),n("div",{staticClass:"details smaller"},[n("label",{attrs:{for:"address"}},[t._v("Address")]),n("a",{staticClass:"copy",attrs:{href:"#"},on:{click:function(e){return t.copyToClipboard(t.address)}}},[n("i",{staticClass:"fad fa-clone"})]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.address,expression:"address"}],staticClass:"copytext",attrs:{type:"text",name:"address"},domProps:{value:t.address},on:{input:function(e){e.target.composing||(t.address=e.target.value)}}})]),n("button",{staticClass:"btn",staticStyle:{"margin-top":"30px"},on:{click:function(e){return t.copyToClipboard("Seed: "+t.seed+"\nPrivate Key: "+t.privatekey+"\nPublic Key: "+t.publickey+"\nAddress: "+t.address)}}},[t._v("Copy To Clipboard")]),n("button",{staticClass:"btn outline",on:{click:function(e){return t.save("Seed: "+t.seed+"\nPrivate Key: "+t.privatekey+"\nPublic Key: "+t.publickey+"\nAddress: "+t.address)}}},[t._v("Download")]),n("wallet",{attrs:{private:t.seed,public:t.address}})],1)],1)},zt=[],Xt=(n("ddb0"),n("2b3d"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wallet"},[n("button",{staticClass:"btn outline",staticStyle:{width:"100%"},attrs:{type:"button"},on:{click:t.createWallet}},[t._v("Create Paper Wallet")]),n("div",{staticClass:"page",class:{active:!1!==t.wallet},staticStyle:{"z-index":"9",top:"0",bottom:"0","justtify-content":"flex-start"}},[n("div",{staticClass:"fdcol"},[n("a",{staticClass:"close",on:{click:t.closeWallet}},[n("i",{staticClass:"fal fa-times"})]),n("div",{staticClass:"printpos"},[n("canvas",{attrs:{width:"2480",height:"3508",id:"wallet_"+t._uid}}),n("div",{staticClass:"posbuttons"},[n("div",{staticClass:"print-position"},[t._v("Paper print position")]),n("button",{staticClass:"btn",class:{outline:1!==t.position},on:{click:function(e){t.position=1}}},[n("img",{attrs:{src:"wallet_preview.png"}})]),n("button",{staticClass:"btn",class:{outline:2!==t.position},on:{click:function(e){t.position=2}}},[n("img",{attrs:{src:"wallet_preview.png"}})]),n("button",{staticClass:"btn",class:{outline:3!==t.position},on:{click:function(e){t.position=3}}},[n("img",{attrs:{src:"wallet_preview.png"}})])])]),n("button",{staticClass:"btn",staticStyle:{width:"100%","margin-top":"20px"},on:{click:t.printWallet}},[t._v("Print")])])]),n("img",{attrs:{src:t.src,id:"printimage"}})])}),Zt=[],te=(n("a15b"),n("d055")),ee=n.n(te),ne={name:"Wallet",props:{private:String,public:String},data:function(){return{wallet:!1,position:1,src:null,loaded:0,canvas:null}},watch:{position:function(t,e){t!==e&&(this.loaded=0,this.createWallet())},loaded:function(t){4===t&&(this.src=this.canvas.toDataURL("image/png"))}},computed:{startTop:function(){return 1===this.position?parseInt(0):parseInt(1100*(this.position-1))}},methods:{closeWallet:function(){this.wallet=!1},createWallet:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var n,a,s,i,r,o,c,l,u,d,p,v,f,h,m,b,g,k,y,w;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=function(t,e,a,s){n.beginPath(),n.setLineDash([10,10]),n.moveTo(t,e),n.lineTo(a,s),n.stroke()},t.wallet=!0,t.canvas=document.getElementById("wallet_"+t._uid),n=t.canvas.getContext("2d"),n.clearRect(0,0,t.canvas.width,t.canvas.height),n.width=2480,n.height=3300,a=827,s=550,i=t,r(0,t.startTop+0,n.width,t.startTop+0),r(0,t.startTop+550,n.width,t.startTop+550),r(0,t.startTop+1100,n.width,t.startTop+1100),r(0,t.startTop+0,0,t.startTop+1100),r(820,t.startTop+0,820,t.startTop+1100),r(1661,t.startTop+0,1661,t.startTop+1100),n.font="24px Nunito",n.fillStyle="#000000",n.fillText("To deposit funds to this paper,",a+40,t.startTop+s+100),n.fillText("wallet, send nano to the public",a+40,t.startTop+s+130),n.fillText("address on the right",a+40,t.startTop+s+160),n.fillText("DO NOT REVEAL THE SEED",a+40,t.startTop+s+220),n.fillText("until you are ready to import",a+40,t.startTop+s+250),n.fillText("the balance to a nano wallet,",a+40,t.startTop+s+280),n.fillText("exchange or online wallet.",a+40,t.startTop+s+310),n.fillText("Amount: ",a+40,t.startTop+s+390),n.fillText("Date:",a+40,t.startTop+s+470),o=new Image,o.src="/wallet.png",o.onload=function(){i.loaded+=1,n.drawImage(o,0,parseInt(i.startTop)-22)},n.fillStyle="#000000",n.save(),n.translate(1240,292),n.rotate(Math.PI),n.translate(-1240,-292),e.next=37,ee.a.toDataURL("nanoseed:"+t.private);case 37:return c=e.sent,n.font="50px Nunito",n.fillText("S E E D",a+40,130-t.startTop),console.log(t.private),l=t.private.substring(0,8),u=t.private.substring(8,16),d=t.private.substring(16,24),p=t.private.substring(24,32),v=t.private.substring(32,40),f=t.private.substring(40,48),h=t.private.substring(48,56),m=t.private.substring(56,64),n.font="38px Monospace",n.fillText(l.split("").join(String.fromCharCode(8202)),a+40,190-t.startTop),n.fillText(u.split("").join(String.fromCharCode(8202)),a+40,230-t.startTop),n.fillText(d.split("").join(String.fromCharCode(8202)),a+40,270-t.startTop),n.fillText(p.split("").join(String.fromCharCode(8202)),a+40,310-t.startTop),n.fillText(v.split("").join(String.fromCharCode(8202)),a+40,350-t.startTop),n.fillText(f.split("").join(String.fromCharCode(8202)),a+40,390-t.startTop),n.fillText(h.split("").join(String.fromCharCode(8202)),a+40,430-t.startTop),n.fillText(m.split("").join(String.fromCharCode(8202)),a+40,470-t.startTop),n.restore(),b=new Image,b.onload=function(){i.loaded+=1;var t=(s-400)/2;n.save(),n.translate(1240,292),n.rotate(Math.PI),n.translate(-1240,-292),n.drawImage(b,a+400,-i.startTop+t,400,400),n.restore()},b.src=c,e.next=64,ee.a.toDataURL("nano:"+t.public);case 64:g=e.sent,n.font="50px Nunito",n.fillText("A D D R E S S",40,t.startTop+s+100),console.log(t.public),l=t.public.substring(0,8),u=t.public.substring(8,16),d=t.public.substring(16,24),p=t.public.substring(24,32),v=t.public.substring(32,40),f=t.public.substring(40,48),h=t.public.substring(48,56),m=t.public.substring(56,64),k=t.public.substring(64,72),n.font="38px Monospace",n.fillStyle="#d43789",n.fillText(l.split("").join(String.fromCharCode(8202)),40,t.startTop+s+160),n.fillStyle="#000000",n.fillText(u.split("").join(String.fromCharCode(8202)),40,t.startTop+s+200),n.fillText(d.split("").join(String.fromCharCode(8202)),40,t.startTop+s+240),n.fillText(p.split("").join(String.fromCharCode(8202)),40,t.startTop+s+280),n.fillText(v.split("").join(String.fromCharCode(8202)),40,t.startTop+s+320),n.fillText(f.split("").join(String.fromCharCode(8202)),40,t.startTop+s+360),n.fillText(h.split("").join(String.fromCharCode(8202)),40,t.startTop+s+400),n.fillStyle="#d43789",n.fillText(m.split("").join(String.fromCharCode(8202)),40,t.startTop+s+440),n.fillText(k.split("").join(String.fromCharCode(8202)),40,t.startTop+s+480),y=new Image,y.onload=function(){i.loaded+=1;var t=(s-400)/2+s;n.drawImage(y,400,i.startTop+t,400,400),n.drawImage(y,a+400,i.startTop+t,400,400)},y.src=g,console.log(c),w=new Image,w.onload=function(){i.loaded+=1;var t=2*a+(a-w.width)/2,e=i.startTop+(s-w.height)/2;n.drawImage(w,t,s+e)},w.src="/wallet_logo.png";case 97:case"end":return e.stop()}}),e)})))()},printWallet:function(){return Object(g["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:window.print();case 1:case"end":return t.stop()}}),t)})))()}}},ae=ne,se=(n("0bee"),Object(d["a"])(ae,Xt,Zt,!1,null,null,null)),ie=se.exports,re={name:"Generate",mixins:[_],components:{Wallet:ie},data:function(){return{newrep:"",seed:"",privatekey:"",publickey:"",address:"",walletdata:{}}},watch:{seed:function(t,e){var n=this;t!==e&&64===t.length&&this.$store.dispatch("app/seedData",t).then((function(t){n.seed=t.seed,n.privatekey=t.privatekey,n.publickey=t.publickey,n.address=t.address}))}},methods:{save:function(t){var e=this.abbreviateAddress(this.address,!1)+".txt",n=new Blob([t],{type:"text/csv"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,e);else{var a=window.document.createElement("a");a.href=window.URL.createObjectURL(n),a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a)}},clearWallet:function(){this.seed="",this.address=""},refreshWallet:function(){var t=this;this.$store.dispatch("app/getSeed").then((function(e){t.seed=e.seed,t.privatekey=e.privatekey,t.publickey=e.publickey,t.address=e.address}))}},computed:{genWalletLink:function(){return"node"in this.$route.params?this.$route.params.node:""}},mounted:function(){var t=this;this.$store.dispatch("app/getSeed").then((function(e){t.seed=e.seed,t.privatekey=e.privatekey,t.publickey=e.publickey,t.address=e.address}))}},oe=re,ce=(n("d418"),Object(d["a"])(oe,Yt,zt,!1,null,"b3c21964",null)),le=ce.exports,ue=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page active",staticStyle:{top:"0"},attrs:{id:"wallet"}},[n("div",{staticClass:"inner"},[n("div",{staticClass:"block"},[t._m(0),n("div",{attrs:{id:"output"}},[n("div",{staticClass:"balance"},[n("div",{staticClass:"raw",class:{active:t.balanceextra},on:{click:function(e){return t.copyToClipboard(t.$route.params.address)}}},[t._v(t._s(t.$route.params.address))]),n("div",{staticClass:"value",domProps:{innerHTML:t._s(t.abbreviateNumber(t.balance))}}),n("div",{staticClass:"raw",class:{active:t.balanceextra}},[t._v(t._s(t.balance))]),n("a",{staticClass:"balanceextra",attrs:{href:""},on:{click:function(e){e.preventDefault(),t.balanceextra=!t.balanceextra}}},[n("i",{staticClass:"fal fa-ellipsis-h",attrs:{"data-fa-transform":"grow-20"}})])])]),n("simplebar",{staticClass:"block history"},[n("div",{staticClass:"headingtitle showmobile"},[t._v("History")]),n("div",{attrs:{id:"pendingblocks"}}),t._l(t.pending,(function(e,a){return n("transaction",{key:a,attrs:{index:a,transaction:e,type:"pending"},on:{blockdetails:function(e){t.blockdetails=e}}})}))],2)],1),n("simplebar",{staticClass:"block history"},[n("div",{staticClass:"headingtitle hidemobile"},[t._v("History")]),t._l(t.history,(function(e,a){return n("transaction",{key:a,attrs:{index:a,transaction:e,type:e.type},on:{blockdetails:function(e){t.blockdetails=e}}})}))],2)],1),n("div",{staticClass:"page",class:{active:null!==t.blockdetails},staticStyle:{top:"0"},attrs:{id:"blockdetails"}},[n("a",{staticClass:"close",on:{click:function(e){t.blockdetails=null}}},[n("i",{staticClass:"fal fa-times"})]),n("block-state",{attrs:{details:t.blockdetails}})],1)])},de=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"headingtitle top"},[n("span",[t._v("Wallet")])])}],pe={name:"Address",components:{Transaction:O,BlockState:_t,simplebar:yt["a"]},mixins:[_],data:function(){return{details:null,balance:0,blockdetails:null,balanceextra:!1}},computed:{history:function(){return this.$store.state.app.history},pending:function(){return this.$store.state.app.pending}},watch:{},methods:{getDetails:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("app/getDetails",t.$route.params.address);case 2:t.details=e.sent,t.$store.dispatch("app/history",t.$route.params.address),t.$store.dispatch("app/pending",t.$route.params.address),t.balance=w["convert"](t.details.balance,t.rawconv),t.representative=t.details.representative;case 7:case"end":return e.stop()}}),e)})))()}},mounted:function(){this.$store.dispatch("app/resetState"),this.getDetails()}},ve=pe,fe=Object(d["a"])(ve,ue,de,!1,null,null,null),he=fe.exports;r["default"].use(f["a"]);var me=[{path:"/",name:"Home",component:Ft},{path:"/node",name:"Node",component:Qt},{path:"/generate",name:"Generate",component:le},{path:"/about",name:"About",component:function(){return n.e("about").then(n.bind(null,"f820"))}},{path:"/block/:hash",name:"Block",component:Ht},{path:"/address/:address",name:"Address",component:he},{path:"/pos/:address",name:"POS",component:Ft},{path:"/:node",name:"Home",component:Ft},{path:"/:node/generate",name:"Generate",component:le},{path:"/:node/block/:hash",name:"Block",component:Ht},{path:"/:node/address/:address",name:"Address",component:he},{path:"/:node/pos/:address",name:"POS",component:Ft}],be=new f["a"]({routes:me}),ge=be,ke=n("2f62");function ye(){return{settings:{pow:1,changeaddress:!0,receiveinterval:1e4,nfctoken:"Ahj98+v1x4Bc5M82YLnZNFjOSgGSGis9VHSc++KhrQHrbZMeiJ3Q7+NqXYVaadKFqk0KerB3NwPLNQhVjPo5uw8AAABheyJvcmlnaW4iOiJodHRwczovL2xpbnV4c2VydmVyLmlvOjQ0MyIsImZlYXR1cmUiOiJXZWJORkMiLCJleHBpcnkiOjE1OTU0NTE1ODYsImlzU3ViZG9tYWluIjp0cnVlfQ==",node:[{address:"nano.linuxserver.io",protocol:"http",port:7076,path:""},{address:"nano2.linuxserver.io",protocol:"http",port:7076,path:""}],presets:{"mynano.ninja":{port:443,path:"/api/node",protocol:"https",headers:{"Content-Type":"application/json"}},"proxy.nanos.cc":{port:443,path:"/proxy",protocol:"https",headers:{"Content-Type":"application/json"}}}},privatekey:null,pow:null,ready:!1,history:[],pending:[],node:{address:null,port:null,path:"",auth:null}}}var we=function(){return ye()};function xe(){return"node"in ge.currentRoute.params?"/"+ge.currentRoute.params.node+"/":"/"}function Ce(t,e){null!==e&&(console.log("Finished calculating"),console.log(e)),t.pow=e}function _e(t,e){t.ready=e}function Se(t,e){t.privatekey=e}function Te(t,e){t.node=e}function Ae(t,e){t.history=e}function Re(t,e){t.pending=e}function $e(t,e){t.balance=e}function Oe(t){Object.assign(t,we())}var je=n("53ca"),Ee=n("5530");function Ne(){return window.location.protocol.replace(":","")}function Pe(){return"https"==Ne()?"7077":"7076"}function Be(t){return De.apply(this,arguments)}function De(){return De=Object(g["a"])(regeneratorRuntime.mark((function t(e){var n,a,s,i,r,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.commit,a=e.state,s=Object(Ee["a"])({},a.node),!0!==a.settings.changeaddress){t.next=9;break}s.address=ge.currentRoute.params.node,s.port=Pe(),s.protocol=Ne(),ge.currentRoute.params.node in a.settings.presets&&(i=a.settings.presets[ge.currentRoute.params.node],s=Object(Ee["a"])(Object(Ee["a"])({},s),i)),t.next=19;break;case 9:o=regeneratorRuntime.mark((function t(){var e,n,i,o,c,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=new AbortController,n=setTimeout((function(){e.abort()}),1e4),i=a.settings.node[r].protocol+"://"+a.settings.node[r].address+":"+a.settings.node[r].port+a.settings.node[r].path,o={method:"POST",body:'{"action":"block_count"}'},o.signal=e.signal,o.headers={},"headers"in a.settings.node[r]&&(o.headers=a.settings.node[r].headers),"auth"in a.settings.node[r]&&null!==a.settings.node[r].auth&&(o.headers["Authorization"]=a.settings.node[r].auth),t.prev=8,console.log("Checking backend: "+i),t.next=12,fetch(i,o);case 12:if(c=t.sent,clearTimeout(n),!c.ok){t.next=27;break}return t.next=17,c.json();case 17:if(l=t.sent,!l.count){t.next=24;break}return console.log("Backend OK: "+i),s=Object(Ee["a"])(Object(Ee["a"])({},s),a.settings.node[r]),t.abrupt("return","break");case 24:console.log(c);case 25:t.next=28;break;case 27:console.log(c);case 28:t.next=34;break;case 30:t.prev=30,t.t0=t["catch"](8),clearTimeout(n),console.log("Timed out: "+i);case 34:case"end":return t.stop()}}),t,null,[[8,30]])})),r=0;case 11:if(!(r<a.settings.node.length)){t.next=19;break}return t.delegateYield(o(),"t0",13);case 13:if(c=t.t0,"break"!==c){t.next=16;break}return t.abrupt("break",19);case 16:r++,t.next=11;break;case 19:"auth"in ge.currentRoute.query&&(s.auth=ge.currentRoute.query.auth),n("node",s);case 21:case"end":return t.stop()}}),t)}))),De.apply(this,arguments)}function Fe(t){return Ie.apply(this,arguments)}function Ie(){return Ie=Object(g["a"])(regeneratorRuntime.mark((function t(e){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,w["generateSeed"]();case 2:return n=t.sent,t.abrupt("return",Le(e,n));case 4:case"end":return t.stop()}}),t)}))),Ie.apply(this,arguments)}function Le(t,e){return Me.apply(this,arguments)}function Me(){return Me=Object(g["a"])(regeneratorRuntime.mark((function t(e,n){var a,s,i,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=w["deriveSecretKey"](n,0),s=w["derivePublicKey"](a),i=w["deriveAddress"](s,{useNanoPrefix:!0}),r={seed:n,privatekey:a,publickey:s,address:i},t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)}))),Me.apply(this,arguments)}function We(t,e){return Ge.apply(this,arguments)}function Ge(){return Ge=Object(g["a"])(regeneratorRuntime.mark((function t(e,n){var a,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={action:"account_info",representative:"true",account:n},t.next=3,He(e,a);case 3:return s=t.sent,t.abrupt("return",s);case 5:case"end":return t.stop()}}),t)}))),Ge.apply(this,arguments)}function He(t,e){return Ue.apply(this,arguments)}function Ue(){return Ue=Object(g["a"])(regeneratorRuntime.mark((function t(e,n){var a,s,i,r,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.commit,s=e.state,null!==s.node.address){t.next=4;break}return t.next=4,Be({commit:a,state:s});case 4:return i=s.node.protocol+"://"+s.node.address+":"+s.node.port+s.node.path,r={method:"POST",body:JSON.stringify(n)},r.headers={},"headers"in s.node&&(r.headers=s.node.headers),null!==s.node.auth&&(r.headers["Authorization"]=s.node.auth),t.next=11,fetch(i,r);case 11:return o=t.sent,t.next=14,o.json();case 14:return c=t.sent,console.log(c),console.log(a),t.abrupt("return",c);case 18:case"end":return t.stop()}}),t)}))),Ue.apply(this,arguments)}var Ve=0;function qe(t,e){return Ke.apply(this,arguments)}function Ke(){return Ke=Object(g["a"])(regeneratorRuntime.mark((function t(e,n){var a,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={},a["action"]="account_history",a["account"]=n,a["count"]=64,console.log("history"),t.prev=5,t.next=8,e.dispatch("rpCall",a);case 8:s=t.sent,Array.isArray(s.history)&&s.history.length&&e.commit("history",s.history),t.next=17;break;case 12:t.prev=12,t.t0=t["catch"](5),console.log(t.t0),console.log("Something went wrong, rate minited maybe? try again"),Ve<3&&setTimeout((function(){Ve++,e.dispatch("history",n)}),2e3);case 17:case"end":return t.stop()}}),t,null,[[5,12]])}))),Ke.apply(this,arguments)}var Je=0;function Qe(t,e){return Ye.apply(this,arguments)}function Ye(){return Ye=Object(g["a"])(regeneratorRuntime.mark((function t(e,n){var a,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={},a["action"]="pending",a["source"]="true",a["sorting"]="true",a["account"]=n,t.prev=5,t.next=8,e.dispatch("rpCall",a);case 8:s=t.sent,console.log("pending1"),"object"===Object(je["a"])(s.blocks)?(console.log("pending"),e.commit("pending",s.blocks)):e.commit("pending",[]),t.next=18;break;case 13:t.prev=13,t.t0=t["catch"](5),console.log(t.t0),console.log("Something went wrong, rate minited maybe? try again"),Je<3&&setTimeout((function(){Je++,e.dispatch("pending",n)}),2e3);case 18:case"end":return t.stop()}}),t,null,[[5,13]])}))),Ye.apply(this,arguments)}function ze(t){var e=t.dispatch,n=t.commit;n("resetState"),e("node")}var Xe={namespaced:!0,state:we,getters:a,mutations:s,actions:i};r["default"].use(ke["a"]);var Ze=new ke["a"].Store({modules:{app:Xe}}),tn=n("ee98"),en=n.n(tn);r["default"].use(en.a),r["default"].config.productionTip=!1,new r["default"]({router:ge,store:Ze,render:function(t){return t(v)}}).$mount("#app")},"5ba3":function(t,e,n){t.exports=function(){return new Worker(n.p+"1602516512737beec51b.worker.js")}},"5c0b":function(t,e,n){"use strict";var a=n("9c0c"),s=n.n(a);s.a},6939:function(t,e,n){},"9c0c":function(t,e,n){},ae55:function(t,e,n){"use strict";var a=n("1594"),s=n.n(a);s.a},d418:function(t,e,n){"use strict";var a=n("0e4f"),s=n.n(a);s.a}});
|
|
//# sourceMappingURL=app.de4e73fc.js.map
|