text: (function(e){function t(t){for(var s,i,o=t[0],c=t[1],l=t[2],d=0,g=[];d<o.length;d++)i=o[d],a[i]&&g.push(a[i][0]),a[i]=0;for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(e[s]=c[s]);h&&h(t);while(g.length)g.shift()();return n.push.apply(n,l||[]),r()}function r(){for(var e,t=0;t<n.length;t++){for(var r=n[t],s=!0,o=1;o<r.length;o++){var c=r[o];0!==a[c]&&(s=!1)}s&&(n.splice(t--,1),e=i(i.s=r[0]))}return e}var s={},a={app:0},n=[];function i(t){if(s[t])return s[t].exports;var r=s[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=s,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(r,s,function(t){return e[t]}.bind(null,s));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=t,o=o.slice();for(var l=0;l<o.length;l++)t(o[l]);var h=c;n.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"034f":function(e,t,r){"use strict";var s=r("64a9"),a=r.n(s);a.a},1:function(e,t){},2:function(e,t){},3:function(e,t){},4:function(e,t){},"56d7":function(e,t,r){"use strict";r.r(t);r("cadf"),r("551c"),r("f751"),r("097d");var s=r("2b0e"),a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticStyle:{"vertical-align":"top"},attrs:{id:"app"}},[r("h3",[e._v("ChainLayer Delegation Tool")]),r("hr"),"Chrome"!=this.$browserDetect.meta.name?r("div",{staticClass:"alert alert-warning"},[e._v("Delegating with Ledger only supported on Chrome")]):e._e(),r("CosmosLedger",{attrs:{msg:"Delegation"}}),r("TerraLedger",{attrs:{msg:"Delegation"}}),r("IrisLedger",{attrs:{msg:"Delegation"}}),r("KavaLedger",{attrs:{msg:"Delegation"}}),r("hr"),e._m(0)],1)},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"alert alert-warning"},[e._v("Delegating on Windows 10 with a Ledger Nano S has had issues since the last Windows update. See "),r("a",{attrs:{href:"https://www.ledger.com/your-ledger-device-and-the-upcoming-windows-10-update/",rel:"nofollow noreferrer noopener"}},[e._v("this Ledger post")]),e._v(" for details")])}],i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"irisLedger",staticStyle:{width:"300px",display:"inline-block","vertical-align":"top"}},[r("img",{attrs:{src:"/img/logo-irisnet.svg",alt:"IrisNet",title:"IrisNet",width:"145",height:"46"}}),r("br"),""!=this.staked?r("span",[r("label",[e._v("Staked by ChainLayer: ")]),r("br"),r("span",[e._v(e._s(e.staked)+" "+e._s(e.denom)+" ("+e._s(e.stakedUSD)+")")]),r("br")]):e._e(),""!=this.price?r("span",[e._v("Price "+e._s(e.denom)+": $ "+e._s(e.price))]):e._e(),r("br"),"Chrome"==this.$browserDetect.meta.name?r("button",{staticClass:"btn btn-outline-success",on:{click:e.show}},[e._v("Delegate")]):e._e(),r("modal",{attrs:{name:"iris-modal",width:600,draggable:!0,scrollable:!0,height:"auto"}},[r("div",{staticClass:"modal-content"},[r("div",{staticClass:"modal-header"},[r("h5",{staticClass:"modal-title"},[e._v("Ledger Delegation ChainLayer")]),r("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:e.hide}},[r("span",{attrs:{"aria-hidden":"true"}},[e._v("×")])])]),r("div",{staticClass:"modal-body"},[r("p",[r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-plug fa-3x"})]),e._v("                  \n                    "),this.readytodelegate?r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-coins fa-3x"})]):e._e(),this.readytodelegate?e._e():r("span",[r("i",{staticClass:"fas fa-coins fa-3x"})])]),1==this.connecting?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Looking for ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.isdelegating?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Delegating, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.iswithdrawing?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Withdrawing rewards, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),""!=this.success?r("span",[r("div",{staticClass:"alert alert-success"},[e._v(e._s(e.success))])]):e._e(),""!=this.error?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.error))])]):e._e(),null!=e.errors.first("derivation")?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.advanced)+e._s(e.errors.first("derivation")))])]):e._e(),this.advanced&&0==this.connecting&&0==this.connected?r("span",[e._v("HD derivation path: "),0==this.connecting&&0==this.connected?r("input",{directives:[{name:"model",rawName:"v-model",value:e.derivation,expression:"derivation"},{name:"validate",rawName:"v-validate",value:{required:!0,regex:/^m44[\/]\d+[\/]\d+[\/]\d+[\/]\d+$/},expression:"{ required: true, regex: /^m44[/]\\d+[/]\\d+[/]\\d+[/]\\d+$/ }"}],staticClass:"form-control",attrs:{name:"derivation",type:"text",placeholder:"m44/118/0/0/0",value:"44/118/0/0/0"},domProps:{value:e.derivation},on:{input:function(t){t.target.composing||(e.derivation=t.target.value)}}}):e._e(),r("br")]):e._e(),0==this.connecting&&0==this.connected?r("span",[r("button",{staticClass:"btn btn-outline-success",on:{click:e.setAdvanced}},[e._v("Advanced Options")]),r("button",{staticClass:"btn btn-outline-success",on:{click:e.tryConnect}},[e._v("Connect Ledger")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v("Your Adress")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v(e._s(e.bech32))]),r("br"),r("br")]):e._e(),""!=this.bech32&&e.advanced?r("span",[r("label",[e._v("Derivation path:")]),e._v(" "+e._s(e.derivation)),r("br")]):e._e(),""!=this.rewards?r("label",[e._v("Rewards: ")]):e._e(),""!=this.rewards?r("span",[e._v(" "+e._s(e.rewards)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_available?r("label",[e._v("Available Balance: ")]):e._e(),""!=this.balance_available?r("span",[e._v(" "+e._s(e.balance_available)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_delegated?r("label",[e._v("Delegated Balance: ")]):e._e(),""!=this.balance_delegated?r("span",[e._v(" "+e._s(e.balance_delegated)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_total?r("label",[e._v("Total Balance: ")]):e._e(),""!=this.balance_total?r("span",[e._v(" "+e._s(e.balance_total)+" "+e._s(e.denom)),r("br"),r("br")]):e._e(),this.readytodelegate?r("label",[e._v("Amount to delegate to ChainLayer (in "+e._s(e.denom)+"): ")]):e._e(),this.readytodelegate?r("input",{directives:[{name:"model",rawName:"v-model.number",value:e.delegation,expression:"delegation",modifiers:{number:!0}}],staticClass:"form-control",attrs:{type:"number"},domProps:{value:e.delegation},on:{keypress:e.onlyNumber,input:function(t){t.target.composing||(e.delegation=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}):e._e(),r("br"),r("br")]),r("div",{staticClass:"modal-footer"},[this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.withdraw}},[e._v("Withdraw")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.delegate}},[e._v("Delegate")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.tryConnect}},[e._v("Refresh")]):e._e(),e._v(" \n                "),r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.hide}},[e._v("Done")])])])])],1)},o=[],c=(r("28a5"),r("96cf"),r("3b8d")),l=r("7fe4"),h=r.n(l),d=r("9dcd"),g=r.n(d),u=r("14f7"),p=u.IrisDelegateTool,b=new h.a,v=new p(b);v.setNodeURL("https://irishub-lcd.chainlayer.net");var m=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),_=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:3,maximumFractionDigits:3}),f={name:"IrisLedger",props:{restUrl:String},data:function(){return{myAddr:"",bech32:"",pk:"",path:"",accInfo:"",sequence:"",delegation:"",reply:"",balance_available:"",balance_delegated:"",balance_total:"",connected:!1,connecting:!1,readytodelegate:!1,debug:!0,denom:"",staked:"",stakedUSD:"",error:"",price:"",chainId:"",validator:"",rewards:"",isdelegating:"",iswithdrawing:"",success:"",advanced:!1,derivation:"m44/118/0/0/0",hrp:"",derivationsplit:"",der_network:"",der_account:"",der_change:"",der_index:""}},computed:{consoleStatus:function(){return this.consoleLog}},created:function(){this.init()},methods:{show:function(){this.$modal.show("iris-modal")},hide:function(){this.$modal.hide("iris-modal")},onlyNumber:function(e){var t=e.keyCode?e.keyCode:e.which;(t<48||t>57)&&46===t&&e.preventDefault()},log:function(e,t){this.debug&&console.log(t)},setAdvanced:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.advanced=!this.advanced;case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),init:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.success="",this.error="",this.myAddr=null,this.denom="Iris",this.isdelegating=!1,this.readytodelegate=!1,this.baseamount=1e18,this.validator="iva1kgddca7qj96z0qcxr2c45z73cfl0c75pmw0meu",this.chainId="irishub",this.log(this.consoleLog,"Trying to connect..."),e.next=12,v.retrieveValidators();case 12:return this.validators=e.sent,this.staked=_.format(g()(this.validators[this.validator].totalShares)),e.next=16,v.getPrice();case 16:this.price=e.sent,this.stakedUSD=m.format(g()(this.validators[this.validator].totalShares*this.price)),this.$emit("irisStake",g()(this.validators[this.validator].totalShares*this.price));case 19:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),tryConnect:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.log(this.consoleLog,"Derivation: "+this.derivation),this.success="",this.isdelegating=!1,this.error="",this.derivationsplit=this.derivation.split("/"),this.der_network=this.derivationsplit[1],this.der_account=this.derivationsplit[2],this.der_change=this.derivationsplit[3],this.der_index=this.derivationsplit[4],e.prev=9,this.connecting=!0,e.next=13,v.connect();case 13:e.next=22;break;case 15:return e.prev=15,e.t0=e["catch"](9),"Error: Unknown Status Code: undefined"==e.t0&&(this.error="Can't find Ledger! Please connect Ledger, enter your pin code and start Terra app. Then click connect again..."),this.log(this.consoleLog,e.t0),this.connected=!1,this.connecting=!1,e.abrupt("return");case 22:if(v.connected){e.next=26;break}return this.connected=!1,this.log(this.consoleLog,v.lastError),e.abrupt("return");case 26:return this.log(this.consoleLog,"Connected!"),e.prev=27,e.next=30,v.retrieveAddress(this.der_network,this.der_account,this.der_change,this.der_index);case 30:this.myAddr=e.sent,e.next=41;break;case 33:return e.prev=33,e.t1=e["catch"](27),this.log(this.consoleLog,e.t1),"Error: Unknown Status Code: 26628"==e.t1&&(this.error="Enter Pin on Ledger"),"Error: Cosmos app does not seem to be open"==e.t1&&(this.error="Ledger app does not seem to be open"),this.connected=!1,this.connecting=!1,e.abrupt("return");case 41:return this.bech32=this.myAddr.bech32,this.pk=this.myAddr.pk,this.path=this.myAddr.path,this.log(this.consoleLog,this.myAddr),this.log(this.consoleLog,"Address  : ".concat(this.myAddr.bech32)),this.log(this.consoleLog,"PublicKey: ".concat(this.myAddr.pk)),this.log(this.consoleLog,"Query ".concat(this.myAddr.bech32)),e.next=50,v.getAccountInfo(this.myAddr);case 50:if(this.accInfo=e.sent,!this.accInfo.error){e.next=57;break}return this.log(this.consoleLog,"getAccountInfo error"),this.log(this.consoleLog,this.accInfo.error),e.abrupt("return");case 57:this.log(this.consoleLog,this.accInfo.error),this.log(this.consoleLog,this.accInfo),this.sequence=this.accInfo.sequence,this.balance_available=_.format(g()(this.accInfo.balance/this.baseamount)),this.delegation=parseInt(this.balance_available);case 62:return e.next=64,v.retrieveBalances([this.myAddr]);case 64:if(this.reply=e.sent,!this.reply.error){e.next=71;break}return this.log(this.consoleLog,"retrieveBalances error"),this.log(this.consoleLog,this.reply.error),e.abrupt("return");case 71:this.log(this.consoleLog,this.reply),this.balance_delegated=_.format(g()(this.reply[0].delegationsTotal)),this.balance_total=_.format(g()(this.reply[0].delegationsTotal/this.baseamount).add(g()(this.accInfo.balance/this.baseamount))),this.log(this.consoleLog,this.reply[0].delegationsTotal);case 75:return e.next=77,v.getRewards(this.myAddr);case 77:this.rewards=e.sent,this.rewards.error?(this.log(this.consoleLog,this.rewards.error),this.rewards=_.format(g()(0/this.baseamount)),this.log(this.consoleLog,"can't get rewards")):(this.log(this.consoleLog,this.rewards),this.rewards=_.format(g()(this.rewards/this.baseamount))),this.readytodelegate=!0,this.connecting=!1,this.connected=!0;case 82:case"end":return e.stop()}},e,this,[[9,15],[27,33]])}));function t(){return e.apply(this,arguments)}return t}(),delegate:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",!(this.delegation>this.balance_available)){e.next=5;break}return this.error="You cannot delegate more than available balance",this.isdelegating=!1,e.abrupt("return");case 5:if(!(this.delegation<=0)){e.next=9;break}return this.error="You need to delegate more than 0",this.isdelegating=!1,e.abrupt("return");case 9:return this.isdelegating=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=13,v.txCreateDelegate(t,this.validator,this.delegation*this.baseamount,"Delegation to ChainLayer.io");case 13:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=16,e.next=19,v.sign(r,t);case 19:s=e.sent,e.next=28;break;case 22:return e.prev=22,e.t0=e["catch"](16),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 28:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=30,e.next=33,v.txSubmit(s);case 33:if(a=e.sent,!a.error){e.next=39;break}return this.error=a.error,this.log(this.consoleLog,a),this.isdelegating=!1,e.abrupt("return");case 39:e.next=47;break;case 41:return e.prev=41,e.t1=e["catch"](30),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 47:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.isdelegating=!1;case 50:case"end":return e.stop()}},e,this,[[16,22],[30,41]])}));function t(){return e.apply(this,arguments)}return t}(),withdraw:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",0!=g()(this.rewards)){e.next=5;break}return this.error="You need rewards to withdraw",this.iswithdrawing=!1,e.abrupt("return");case 5:return this.iswithdrawing=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=9,v.txCreateWithdrawl(t,"Delegation to ChainLayer.io");case 9:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=12,e.next=15,v.sign(r,t);case 15:s=e.sent,e.next=24;break;case 18:return e.prev=18,e.t0=e["catch"](12),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 24:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=26,e.next=29,v.txSubmit(s);case 29:if(a=e.sent,!a.error){e.next=35;break}return this.error=a.error,this.log(this.consoleLog,a),this.iswithdrawing=!1,e.abrupt("return");case 35:e.next=43;break;case 37:return e.prev=37,e.t1=e["catch"](26),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 43:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.iswithdrawing=!1;case 46:case"end":return e.stop()}},e,this,[[12,18],[26,37]])}));function t(){return e.apply(this,arguments)}return t}()}},w=f,y=r("2877"),k=Object(y["a"])(w,i,o,!1,null,null,null),x=k.exports,L=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"cosmosLedger",staticStyle:{width:"300px",display:"inline-block","vertical-align":"top"}},[r("img",{attrs:{src:"/img/logo-cosmos.svg",alt:"Cosmos",title:"Cosmos",width:"145",height:"46"}}),r("br"),""!=this.staked?r("span",[r("label",[e._v("Staked by ChainLayer: ")]),r("br"),r("span",[e._v(e._s(e.staked)+" "+e._s(e.denom)+" ("+e._s(e.stakedUSD)+")")]),r("br")]):e._e(),""!=this.price?r("span",[e._v("Price "+e._s(e.denom)+": $ "+e._s(e.price))]):e._e(),r("br"),"Chrome"==this.$browserDetect.meta.name?r("button",{staticClass:"btn btn-outline-success",on:{click:e.show}},[e._v("Delegate")]):e._e(),r("modal",{attrs:{name:"cosmos-modal",width:600,draggable:!0,scrollable:!0,height:"auto"}},[r("div",{staticClass:"modal-content"},[r("div",{staticClass:"modal-header"},[r("h5",{staticClass:"modal-title"},[e._v("Ledger Delegation ChainLayer")]),r("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:e.hide}},[r("span",{attrs:{"aria-hidden":"true"}},[e._v("×")])])]),r("div",{staticClass:"modal-body"},[r("p",[r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-plug fa-3x"})]),e._v("                  \n                    "),this.readytodelegate?r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-coins fa-3x"})]):e._e(),this.readytodelegate?e._e():r("span",[r("i",{staticClass:"fas fa-coins fa-3x"})])]),1==this.connecting?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Looking for ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.isdelegating?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Delegating, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.iswithdrawing?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Withdrawing rewards, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),""!=this.success?r("span",[r("div",{staticClass:"alert alert-success"},[e._v(e._s(e.success))])]):e._e(),""!=this.error?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.error))])]):e._e(),null!=e.errors.first("derivation")?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.advanced)+e._s(e.errors.first("derivation")))])]):e._e(),this.advanced&&0==this.connecting&&0==this.connected?r("span",[e._v("HD derivation path: "),0==this.connecting&&0==this.connected?r("input",{directives:[{name:"model",rawName:"v-model",value:e.derivation,expression:"derivation"},{name:"validate",rawName:"v-validate",value:{required:!0,regex:/^m44[\/]\d+[\/]\d+[\/]\d+[\/]\d+$/},expression:"{ required: true, regex: /^m44[/]\\d+[/]\\d+[/]\\d+[/]\\d+$/ }"}],staticClass:"form-control",attrs:{name:"derivation",type:"text",placeholder:"m44/118/0/0/0",value:"44/118/0/0/0"},domProps:{value:e.derivation},on:{input:function(t){t.target.composing||(e.derivation=t.target.value)}}}):e._e(),r("br")]):e._e(),0==this.connecting&&0==this.connected?r("span",[r("button",{staticClass:"btn btn-outline-success",on:{click:e.setAdvanced}},[e._v("Advanced Options")]),r("button",{staticClass:"btn btn-outline-success",on:{click:e.tryConnect}},[e._v("Connect Ledger")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v("Your Adress")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v(e._s(e.bech32))]),r("br"),r("br")]):e._e(),""!=this.bech32&&e.advanced?r("span",[r("label",[e._v("Derivation path:")]),e._v(" "+e._s(e.derivation)),r("br")]):e._e(),""!=this.rewards?r("label",[e._v("Rewards: ")]):e._e(),""!=this.rewards?r("span",[e._v(" "+e._s(e.rewards)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_available?r("label",[e._v("Available Balance: ")]):e._e(),""!=this.balance_available?r("span",[e._v(" "+e._s(e.balance_available)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_delegated?r("label",[e._v("Delegated Balance: ")]):e._e(),""!=this.balance_delegated?r("span",[e._v(" "+e._s(e.balance_delegated)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_total?r("label",[e._v("Total Balance: ")]):e._e(),""!=this.balance_total?r("span",[e._v(" "+e._s(e.balance_total)+" "+e._s(e.denom)),r("br"),r("br")]):e._e(),this.readytodelegate?r("label",[e._v("Amount to delegate to ChainLayer (in "+e._s(e.denom)+"): ")]):e._e(),this.readytodelegate?r("input",{directives:[{name:"model",rawName:"v-model.number",value:e.delegation,expression:"delegation",modifiers:{number:!0}}],staticClass:"form-control",attrs:{type:"number"},domProps:{value:e.delegation},on:{keypress:e.onlyNumber,input:function(t){t.target.composing||(e.delegation=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}):e._e(),r("br"),r("br")]),r("div",{staticClass:"modal-footer"},[this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.withdraw}},[e._v("Withdraw")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.delegate}},[e._v("Delegate")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.tryConnect}},[e._v("Refresh")]):e._e(),e._v(" \n                "),r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.hide}},[e._v("Done")])])])])],1)},C=[],A=r("14f7"),S=A.CosmosDelegateTool,D=new h.a,I=new S(D);I.setNodeURL("https://cosmoshub-lcd.chainlayer.net");var T=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),j=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:3,maximumFractionDigits:3}),E={name:"CosmosLedger",props:{restUrl:String},data:function(){return{myAddr:"",bech32:"",pk:"",path:"",accInfo:"",sequence:"",delegation:"",reply:"",balance_available:"",balance_delegated:"",balance_total:"",connected:!1,connecting:!1,readytodelegate:!1,debug:!0,denom:"",staked:"",stakedUSD:"",error:"",price:"",chainId:"",validator:"",rewards:"",isdelegating:"",iswithdrawing:"",success:"",advanced:!1,derivation:"m44/118/0/0/0",hrp:"",derivationsplit:"",der_network:"",der_account:"",der_change:"",der_index:""}},computed:{consoleStatus:function(){return this.consoleLog}},created:function(){this.init()},methods:{show:function(){this.$modal.show("cosmos-modal")},hide:function(){this.$modal.hide("cosmos-modal")},onlyNumber:function(e){var t=e.keyCode?e.keyCode:e.which;(t<48||t>57)&&46===t&&e.preventDefault()},log:function(e,t){this.debug&&console.log(t)},setAdvanced:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.advanced=!this.advanced;case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),init:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.success="",this.error="",this.myAddr=null,this.denom="Atom",this.isdelegating=!1,this.readytodelegate=!1,this.baseamount=1e6,this.validator="cosmosvaloper1kgddca7qj96z0qcxr2c45z73cfl0c75p7f3s2e",this.chainId="cosmoshub-3",this.log(this.consoleLog,"Trying to connect..."),e.next=12,I.retrieveValidators();case 12:return this.validators=e.sent,this.staked=j.format(g()(this.validators[this.validator].totalShares/this.baseamount)),e.next=16,I.getPrice();case 16:this.price=e.sent,this.stakedUSD=T.format(g()(this.validators[this.validator].totalShares/this.baseamount*this.price)),this.$emit("cosmosStake",g()(this.validators[this.validator].totalShares/this.baseamount*this.price));case 19:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),tryConnect:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.log(this.consoleLog,"Derivation: "+this.derivation),this.success="",this.isdelegating=!1,this.error="",this.derivationsplit=this.derivation.split("/"),this.der_network=this.derivationsplit[1],this.der_account=this.derivationsplit[2],this.der_change=this.derivationsplit[3],this.der_index=this.derivationsplit[4],e.prev=9,this.connecting=!0,e.next=13,I.connect();case 13:e.next=23;break;case 15:return e.prev=15,e.t0=e["catch"](9),"Error: Unknown Status Code: undefined"==e.t0&&(this.error="Can't find Ledger! Please connect Ledger, enter your pin code and start Terra app. Then click connect again..."),"Error: Cosmos app does not seem to be open"==e.t0&&(this.error="Ledger app does not seem to be open"),this.log(this.consoleLog,e.t0),this.connected=!1,this.connecting=!1,e.abrupt("return");case 23:if(I.connected){e.next=27;break}return this.connected=!1,this.log(this.consoleLog,I.lastError),e.abrupt("return");case 27:return this.log(this.consoleLog,"Connected!"),e.prev=28,e.next=31,I.retrieveAddress(this.der_network,this.der_account,this.der_change,this.der_index);case 31:this.myAddr=e.sent,e.next=41;break;case 34:return e.prev=34,e.t1=e["catch"](28),this.log(this.consoleLog,e.t1),"Error: Unknown Status Code: 26628"==e.t1&&(this.error="Enter Pin on Ledger"),this.connected=!1,this.connecting=!1,e.abrupt("return");case 41:return this.bech32=this.myAddr.bech32,this.pk=this.myAddr.pk,this.path=this.myAddr.path,this.log(this.consoleLog,this.myAddr),this.log(this.consoleLog,"Address  : ".concat(this.myAddr.bech32)),this.log(this.consoleLog,"PublicKey: ".concat(this.myAddr.pk)),this.log(this.consoleLog,"Query ".concat(this.myAddr.bech32)),e.next=50,I.getAccountInfo(this.myAddr);case 50:if(this.accInfo=e.sent,!this.accInfo.error){e.next=57;break}return this.log(this.consoleLog,"getAccountInfo error"),this.log(this.consoleLog,this.accInfo.error),e.abrupt("return");case 57:this.log(this.consoleLog,this.accInfo.error),this.log(this.consoleLog,this.accInfo),this.sequence=this.accInfo.sequence,this.balance_available=j.format(g()(this.accInfo.balance/this.baseamount)),this.delegation=parseInt(this.balance_available);case 62:return e.next=64,I.retrieveBalances([this.myAddr]);case 64:if(this.reply=e.sent,!this.reply.error){e.next=71;break}return this.log(this.consoleLog,"retrieveBalances error"),this.log(this.consoleLog,this.reply.error),e.abrupt("return");case 71:this.log(this.consoleLog,this.reply),this.balance_delegated=j.format(g()(this.reply[0].delegationsTotal/this.baseamount)),this.balance_total=j.format(g()(this.reply[0].delegationsTotal/this.baseamount).add(g()(this.accInfo.balance/this.baseamount))),this.log(this.consoleLog,this.reply[0].delegationsTotal);case 75:return e.next=77,I.getRewards(this.myAddr);case 77:this.rewards=e.sent,this.rewards.error?(this.log(this.consoleLog,this.rewards.error),this.rewards=j.format(g()(0/this.baseamount)),this.log(this.consoleLog,"can't get rewards")):(this.log(this.consoleLog,this.rewards),this.rewards=j.format(g()(this.rewards/this.baseamount))),this.readytodelegate=!0,this.connecting=!1,this.connected=!0;case 82:case"end":return e.stop()}},e,this,[[9,15],[28,34]])}));function t(){return e.apply(this,arguments)}return t}(),delegate:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",!(this.delegation>this.balance_available)){e.next=5;break}return this.error="You cannot delegate more than available balance",this.isdelegating=!1,e.abrupt("return");case 5:if(!(this.delegation<=0)){e.next=9;break}return this.error="You need to delegate more than 0",this.isdelegating=!1,e.abrupt("return");case 9:return this.isdelegating=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=13,I.txCreateDelegate(t,this.validator,this.delegation*this.baseamount,"Delegation to ChainLayer.io");case 13:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=16,e.next=19,I.sign(r,t);case 19:s=e.sent,e.next=28;break;case 22:return e.prev=22,e.t0=e["catch"](16),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 28:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=30,e.next=33,I.txSubmit(s);case 33:if(a=e.sent,!a.error){e.next=39;break}return this.error=a.error,this.log(this.consoleLog,a),this.isdelegating=!1,e.abrupt("return");case 39:e.next=47;break;case 41:return e.prev=41,e.t1=e["catch"](30),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 47:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.isdelegating=!1;case 50:case"end":return e.stop()}},e,this,[[16,22],[30,41]])}));function t(){return e.apply(this,arguments)}return t}(),withdraw:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",0!=g()(this.rewards)){e.next=5;break}return this.error="You need rewards to withdraw",this.iswithdrawing=!1,e.abrupt("return");case 5:return this.iswithdrawing=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=9,I.txCreateWithdrawl(t,this.validator,"Delegation to ChainLayer.io");case 9:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=12,e.next=15,I.sign(r,t);case 15:s=e.sent,e.next=24;break;case 18:return e.prev=18,e.t0=e["catch"](12),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 24:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=26,e.next=29,I.txSubmit(s);case 29:if(a=e.sent,!a.error){e.next=35;break}return this.error=a.error,this.log(this.consoleLog,a),this.iswithdrawing=!1,e.abrupt("return");case 35:e.next=43;break;case 37:return e.prev=37,e.t1=e["catch"](26),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 43:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.iswithdrawing=!1;case 46:case"end":return e.stop()}},e,this,[[12,18],[26,37]])}));function t(){return e.apply(this,arguments)}return t}()}},U=E,R=Object(y["a"])(U,L,C,!1,null,null,null),P=R.exports,$=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"terraLedger",staticStyle:{width:"300px",display:"inline-block","vertical-align":"top"}},[r("img",{attrs:{src:"/img/logo-terra.svg",alt:"Terra",title:"Terra",width:"145",height:"46"}}),r("br"),""!=this.staked?r("span",[r("label",[e._v("Staked by ChainLayer: ")]),r("br"),r("span",[e._v(e._s(e.staked)+" "+e._s(e.denom)+" ("+e._s(e.stakedUSD)+")")]),r("br")]):e._e(),""!=this.price?r("span",[e._v("Price "+e._s(e.denom)+": $ "+e._s(e.price))]):e._e(),r("br"),"Chrome"==this.$browserDetect.meta.name?r("button",{staticClass:"btn btn-outline-success",on:{click:e.show}},[e._v("Delegate")]):e._e(),r("modal",{attrs:{name:"terra-modal",width:600,draggable:!0,scrollable:!0,height:"auto"}},[r("div",{staticClass:"modal-content"},[r("div",{staticClass:"modal-header"},[r("h5",{staticClass:"modal-title"},[e._v("Ledger Delegation ChainLayer")]),r("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:e.hide}},[r("span",{attrs:{"aria-hidden":"true"}},[e._v("×")])])]),r("div",{staticClass:"modal-body"},[r("p",[r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-plug fa-3x"})]),e._v("                  \n                    "),this.readytodelegate?r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-coins fa-3x"})]):e._e(),this.readytodelegate?e._e():r("span",[r("i",{staticClass:"fas fa-coins fa-3x"})])]),1==this.connecting?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Looking for ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.isdelegating?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Delegating, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.iswithdrawing?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Withdrawing rewards, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),""!=this.success?r("span",[r("div",{staticClass:"alert alert-success"},[e._v(e._s(e.success))])]):e._e(),""!=this.error?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.error))])]):e._e(),null!=e.errors.first("derivation")?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.advanced)+e._s(e.errors.first("derivation")))])]):e._e(),this.advanced&&0==this.connecting&&0==this.connected?r("span",[e._v("HD derivation path: "),0==this.connecting&&0==this.connected?r("input",{directives:[{name:"model",rawName:"v-model",value:e.derivation,expression:"derivation"},{name:"validate",rawName:"v-validate",value:{required:!0,regex:/^m44[\/]\d+[\/]\d+[\/]\d+[\/]\d+$/},expression:"{ required: true, regex: /^m44[/]\\d+[/]\\d+[/]\\d+[/]\\d+$/ }"}],staticClass:"form-control",attrs:{name:"derivation",type:"text",placeholder:"m44/118/0/0/0",value:"44/118/0/0/0"},domProps:{value:e.derivation},on:{input:function(t){t.target.composing||(e.derivation=t.target.value)}}}):e._e(),r("br")]):e._e(),0==this.connecting&&0==this.connected?r("span",[r("button",{staticClass:"btn btn-outline-success",on:{click:e.setAdvanced}},[e._v("Advanced Options")]),r("button",{staticClass:"btn btn-outline-success",on:{click:e.tryConnect}},[e._v("Connect Ledger")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v("Your Adress")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v(e._s(e.bech32))]),r("br"),r("br")]):e._e(),""!=this.bech32&&e.advanced?r("span",[r("label",[e._v("Derivation path:")]),e._v(" "+e._s(e.derivation)),r("br")]):e._e(),""!=this.rewards?r("label",[e._v("Rewards: ")]):e._e(),""!=this.rewards?r("span",[e._v(" "+e._s(e.rewards)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_available?r("label",[e._v("Available Balance: ")]):e._e(),""!=this.balance_available?r("span",[e._v(" "+e._s(e.balance_available)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_delegated?r("label",[e._v("Delegated Balance: ")]):e._e(),""!=this.balance_delegated?r("span",[e._v(" "+e._s(e.balance_delegated)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_total?r("label",[e._v("Total Balance: ")]):e._e(),""!=this.balance_total?r("span",[e._v(" "+e._s(e.balance_total)+" "+e._s(e.denom)),r("br"),r("br")]):e._e(),this.readytodelegate?r("label",[e._v("Amount to delegate to ChainLayer (in "+e._s(e.denom)+"): ")]):e._e(),this.readytodelegate?r("input",{directives:[{name:"model",rawName:"v-model.number",value:e.delegation,expression:"delegation",modifiers:{number:!0}}],staticClass:"form-control",attrs:{type:"number"},domProps:{value:e.delegation},on:{keypress:e.onlyNumber,input:function(t){t.target.composing||(e.delegation=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}):e._e(),r("br"),r("br")]),r("div",{staticClass:"modal-footer"},[this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.withdraw}},[e._v("Withdraw")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.delegate}},[e._v("Delegate")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.tryConnect}},[e._v("Refresh")]):e._e(),e._v(" \n                "),r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.hide}},[e._v("Done")])])])])],1)},O=[],N=r("14f7"),B=N.TerraDelegateTool,q=new h.a,W=new B(q);W.setNodeURL("https://columbus-lcd.chainlayer.net");var F=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),Y=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:3,maximumFractionDigits:3}),K={name:"TerraLedger",props:{restUrl:String},data:function(){return{myAddr:"",bech32:"",pk:"",path:"",accInfo:"",sequence:"",delegation:"",reply:"",balance_available:"",balance_delegated:"",balance_total:"",connected:!1,connecting:!1,readytodelegate:!1,debug:!0,denom:"",staked:"",stakedUSD:"",error:"",price:"",chainId:"",validator:"",rewards:"",isdelegating:"",iswithdrawing:"",success:"",advanced:!1,derivation:"m44/330/0/0/0",hrp:"",derivationsplit:"",der_network:"",der_account:"",der_change:"",der_index:""}},computed:{consoleStatus:function(){return this.consoleLog}},created:function(){this.init()},methods:{show:function(){this.$modal.show("terra-modal")},hide:function(){this.$modal.hide("terra-modal")},onlyNumber:function(e){var t=e.keyCode?e.keyCode:e.which;(t<48||t>57)&&46!==t&&e.preventDefault()},log:function(e,t){this.debug&&console.log(t)},setAdvanced:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.advanced=!this.advanced;case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),init:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.success="",this.error="",this.myAddr=null,this.denom="Luna",this.isdelegating=!1,this.readytodelegate=!1,this.baseamount=1e6,this.validator="terravaloper1kgddca7qj96z0qcxr2c45z73cfl0c75paknc5e",this.chainId="columbus-3",this.log(this.consoleLog,"Trying to connect..."),e.next=12,W.retrieveValidators();case 12:return this.validators=e.sent,this.staked=Y.format(g()(this.validators[this.validator].totalShares/this.baseamount)),e.next=16,W.getPrice();case 16:this.price=e.sent,this.stakedUSD=F.format(g()(this.validators[this.validator].totalShares/this.baseamount*this.price)),this.$emit("terraStake",g()(this.validators[this.validator].totalShares/this.baseamount*this.price));case 19:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),tryConnect:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.log(this.consoleLog,"Derivation: "+this.derivation),this.success="",this.isdelegating=!1,this.error="",this.derivationsplit=this.derivation.split("/"),this.der_network=this.derivationsplit[1],this.der_account=this.derivationsplit[2],this.der_change=this.derivationsplit[3],this.der_index=this.derivationsplit[4],e.prev=9,this.connecting=!0,e.next=13,W.connect();case 13:e.next=23;break;case 15:return e.prev=15,e.t0=e["catch"](9),"Error: Unknown Status Code: undefined"==e.t0&&(this.error="Can't find Ledger! Please connect Ledger, enter your pin code and start Terra app. Then click connect again..."),"Error: Cosmos app does not seem to be open"==e.t0&&(this.error="Ledger app does not seem to be open"),this.log(this.consoleLog,e.t0),this.connected=!1,this.connecting=!1,e.abrupt("return");case 23:if(W.connected){e.next=27;break}return this.connected=!1,this.log(this.consoleLog,W.lastError),e.abrupt("return");case 27:return this.log(this.consoleLog,"Connected!"),e.prev=28,e.next=31,W.retrieveAddress(this.der_network,this.der_account,this.der_change,this.der_index);case 31:this.myAddr=e.sent,e.next=41;break;case 34:return e.prev=34,e.t1=e["catch"](28),this.log(this.consoleLog,e.t1),"Error: Unknown Status Code: 26628"==e.t1&&(this.error="Enter Pin on Ledger"),this.connected=!1,this.connecting=!1,e.abrupt("return");case 41:return this.bech32=this.myAddr.bech32,this.pk=this.myAddr.pk,this.path=this.myAddr.path,this.log(this.consoleLog,this.myAddr),this.log(this.consoleLog,"Address  : ".concat(this.myAddr.bech32)),this.log(this.consoleLog,"PublicKey: ".concat(this.myAddr.pk)),this.log(this.consoleLog,"Query ".concat(this.myAddr.bech32)),e.next=50,W.getAccountInfo(this.myAddr);case 50:if(this.accInfo=e.sent,!this.accInfo.error){e.next=57;break}return this.log(this.consoleLog,"getAccountInfo error"),this.log(this.consoleLog,this.accInfo.error),e.abrupt("return");case 57:this.log(this.consoleLog,this.accInfo.error),this.log(this.consoleLog,this.accInfo),this.sequence=this.accInfo.sequence,this.balance_available=Y.format(g()(this.accInfo.balance/this.baseamount)),this.delegation=parseInt(this.balance_available);case 62:return e.next=64,W.retrieveBalances([this.myAddr]);case 64:if(this.reply=e.sent,!this.reply.error){e.next=71;break}return this.log(this.consoleLog,"retrieveBalances error"),this.log(this.consoleLog,this.reply.error),e.abrupt("return");case 71:this.log(this.consoleLog,this.reply),this.balance_delegated=Y.format(g()(this.reply[0].delegationsTotal/this.baseamount)),this.balance_total=Y.format(g()(this.reply[0].delegationsTotal/this.baseamount).add(g()(this.accInfo.balance/this.baseamount))),this.log(this.consoleLog,this.reply[0].delegationsTotal);case 75:return e.next=77,W.getRewards(this.validator,this.myAddr);case 77:this.rewards=e.sent,this.rewards.error?(this.log(this.consoleLog,this.rewards.error),this.rewards=Y.format(g()(0/this.baseamount)),this.log(this.consoleLog,"can't get rewards")):(this.log(this.consoleLog,this.rewards),this.rewards=Y.format(g()(this.rewards/this.baseamount))),this.readytodelegate=!0,this.connecting=!1,this.connected=!0;case 82:case"end":return e.stop()}},e,this,[[9,15],[28,34]])}));function t(){return e.apply(this,arguments)}return t}(),delegate:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",!(this.delegation>this.balance_available)){e.next=5;break}return this.error="You cannot delegate more than available balance",this.isdelegating=!1,e.abrupt("return");case 5:if(!(this.delegation<=0)){e.next=9;break}return this.error="You need to delegate more than 0",this.isdelegating=!1,e.abrupt("return");case 9:return this.isdelegating=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=13,W.txCreateDelegate(t,this.validator,this.delegation*this.baseamount,"Delegation to ChainLayer.io");case 13:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=16,e.next=19,W.sign(r,t);case 19:s=e.sent,e.next=28;break;case 22:return e.prev=22,e.t0=e["catch"](16),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 28:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=30,e.next=33,W.txSubmit(s);case 33:if(a=e.sent,!a.error){e.next=39;break}return this.error=a.error,this.log(this.consoleLog,a),this.isdelegating=!1,e.abrupt("return");case 39:e.next=47;break;case 41:return e.prev=41,e.t1=e["catch"](30),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 47:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.isdelegating=!1;case 50:case"end":return e.stop()}},e,this,[[16,22],[30,41]])}));function t(){return e.apply(this,arguments)}return t}(),withdraw:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",0!=g()(this.rewards)){e.next=5;break}return this.error="You need rewards to withdraw",this.iswithdrawing=!1,e.abrupt("return");case 5:return this.iswithdrawing=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=9,W.txCreateWithdrawl(t,this.validator,"Delegation to ChainLayer.io");case 9:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=12,e.next=15,W.sign(r,t);case 15:s=e.sent,e.next=24;break;case 18:return e.prev=18,e.t0=e["catch"](12),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 24:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=26,e.next=29,W.txSubmit(s);case 29:if(a=e.sent,!a.error){e.next=35;break}return this.error=a.error,this.log(this.consoleLog,a),this.iswithdrawing=!1,e.abrupt("return");case 35:e.next=43;break;case 37:return e.prev=37,e.t1=e["catch"](26),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 43:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.iswithdrawing=!1;case 46:case"end":return e.stop()}},e,this,[[12,18],[26,37]])}));function t(){return e.apply(this,arguments)}return t}()}},z=K,H=Object(y["a"])(z,$,O,!1,null,null,null),M=H.exports,Q=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"kavaLedger",staticStyle:{width:"300px",display:"inline-block","vertical-align":"top"}},[r("img",{attrs:{src:"/img/logo-kava.svg",alt:"Kava",title:"Kava",width:"145",height:"46"}}),r("br"),""!=this.staked?r("span",[r("label",[e._v("Staked by ChainLayer: ")]),r("br"),r("span",[e._v(e._s(e.staked)+" "+e._s(e.denom)+" ("+e._s(e.stakedUSD)+")")]),r("br")]):e._e(),""!=this.price?r("span",[e._v("Price "+e._s(e.denom)+": $ "+e._s(e.price))]):e._e(),r("br"),"Chrome"==this.$browserDetect.meta.name?r("button",{staticClass:"btn btn-outline-success",on:{click:e.show}},[e._v("Delegate")]):e._e(),r("modal",{attrs:{name:"kava-modal",width:600,draggable:!0,scrollable:!0,height:"auto"}},[r("div",{staticClass:"modal-content"},[r("div",{staticClass:"modal-header"},[r("h5",{staticClass:"modal-title"},[e._v("Ledger Delegation ChainLayer")]),r("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:e.hide}},[r("span",{attrs:{"aria-hidden":"true"}},[e._v("×")])])]),r("div",{staticClass:"modal-body"},[r("p",[r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-plug fa-3x"})]),e._v("                  \n                    "),this.readytodelegate?r("span",{staticStyle:{color:"forestgreen"}},[r("i",{staticClass:"fas fa-coins fa-3x"})]):e._e(),this.readytodelegate?e._e():r("span",[r("i",{staticClass:"fas fa-coins fa-3x"})])]),1==this.connecting?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Looking for ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.isdelegating?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Delegating, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),1==this.iswithdrawing?r("span",[r("div",{staticClass:"alert alert-info"},[e._v("Withdrawing rewards, please check ledger")]),r("br"),r("img",{attrs:{src:"/img/Spinner.gif",height:"93",width:"93"}}),r("br")]):e._e(),""!=this.success?r("span",[r("div",{staticClass:"alert alert-success"},[e._v(e._s(e.success))])]):e._e(),""!=this.error?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.error))])]):e._e(),null!=e.errors.first("derivation")?r("span",[r("div",{staticClass:"alert alert-warning"},[e._v(e._s(e.advanced)+e._s(e.errors.first("derivation")))])]):e._e(),this.advanced&&0==this.connecting&&0==this.connected?r("span",[e._v("HD derivation path: "),0==this.connecting&&0==this.connected?r("input",{directives:[{name:"model",rawName:"v-model",value:e.derivation,expression:"derivation"},{name:"validate",rawName:"v-validate",value:{required:!0,regex:/^m44[\/]\d+[\/]\d+[\/]\d+[\/]\d+$/},expression:"{ required: true, regex: /^m44[/]\\d+[/]\\d+[/]\\d+[/]\\d+$/ }"}],staticClass:"form-control",attrs:{name:"derivation",type:"text",placeholder:"m44/118/0/0/0",value:"44/118/0/0/0"},domProps:{value:e.derivation},on:{input:function(t){t.target.composing||(e.derivation=t.target.value)}}}):e._e(),r("br")]):e._e(),0==this.connecting&&0==this.connected?r("span",[r("button",{staticClass:"btn btn-outline-success",on:{click:e.setAdvanced}},[e._v("Advanced Options")]),r("button",{staticClass:"btn btn-outline-success",on:{click:e.tryConnect}},[e._v("Connect Ledger")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v("Your Adress")]),r("br")]):e._e(),""!=this.bech32?r("span",[r("b",[e._v(e._s(e.bech32))]),r("br"),r("br")]):e._e(),""!=this.bech32&&e.advanced?r("span",[r("label",[e._v("Derivation path:")]),e._v(" "+e._s(e.derivation)),r("br")]):e._e(),""!=this.rewards?r("label",[e._v("Rewards: ")]):e._e(),""!=this.rewards?r("span",[e._v(" "+e._s(e.rewards)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_available?r("label",[e._v("Available Balance: ")]):e._e(),""!=this.balance_available?r("span",[e._v(" "+e._s(e.balance_available)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_delegated?r("label",[e._v("Delegated Balance: ")]):e._e(),""!=this.balance_delegated?r("span",[e._v(" "+e._s(e.balance_delegated)+" "+e._s(e.denom)),r("br")]):e._e(),""!=this.balance_total?r("label",[e._v("Total Balance: ")]):e._e(),""!=this.balance_total?r("span",[e._v(" "+e._s(e.balance_total)+" "+e._s(e.denom)),r("br"),r("br")]):e._e(),this.readytodelegate?r("label",[e._v("Amount to delegate to ChainLayer (in "+e._s(e.denom)+"): ")]):e._e(),this.readytodelegate?r("input",{directives:[{name:"model",rawName:"v-model.number",value:e.delegation,expression:"delegation",modifiers:{number:!0}}],staticClass:"form-control",attrs:{type:"number"},domProps:{value:e.delegation},on:{keypress:e.onlyNumber,input:function(t){t.target.composing||(e.delegation=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}):e._e(),r("br"),r("br")]),r("div",{staticClass:"modal-footer"},[this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.withdraw}},[e._v("Withdraw")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.delegate}},[e._v("Delegate")]):e._e(),e._v(" \n                "),this.readytodelegate?r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.tryConnect}},[e._v("Refresh")]):e._e(),e._v(" \n                "),r("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:e.hide}},[e._v("Done")])])])])],1)},V=[],J=r("14f7"),G=J.KavaDelegateTool,X=new h.a,Z=new G(X);Z.setNodeURL("https://kava-lcd.chainlayer.net");var ee=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),te=new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:3,maximumFractionDigits:3}),re={name:"KavaLedger",props:{restUrl:String},data:function(){return{myAddr:"",bech32:"",pk:"",path:"",accInfo:"",sequence:"",delegation:"",reply:"",balance_available:"",balance_delegated:"",balance_total:"",connected:!1,connecting:!1,readytodelegate:!1,debug:!0,denom:"",staked:"",stakedUSD:"",error:"",price:"",chainId:"",validator:"",rewards:"",isdelegating:"",iswithdrawing:"",success:"",advanced:!1,derivation:"m44/118/0/0/0",hrp:"",derivationsplit:"",der_network:"",der_account:"",der_change:"",der_index:""}},computed:{consoleStatus:function(){return this.consoleLog}},created:function(){this.init()},methods:{show:function(){this.$modal.show("kava-modal")},hide:function(){this.$modal.hide("kava-modal")},onlyNumber:function(e){var t=e.keyCode?e.keyCode:e.which;(t<48||t>57)&&46===t&&e.preventDefault()},log:function(e,t){this.debug&&console.log(t)},setAdvanced:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.advanced=!this.advanced;case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),init:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.success="",this.error="",this.myAddr=null,this.denom="Kava",this.isdelegating=!1,this.readytodelegate=!1,this.baseamount=1e6,this.validator="kavavaloper1kgddca7qj96z0qcxr2c45z73cfl0c75p27tsg6",this.chainId="kava-2",this.log(this.consoleLog,"Trying to connect..."),e.next=12,Z.retrieveValidators();case 12:return this.validators=e.sent,this.staked=te.format(g()(this.validators[this.validator].totalShares/this.baseamount)),e.next=16,Z.getPrice();case 16:this.price=e.sent,this.stakedUSD=ee.format(g()(this.validators[this.validator].totalShares/this.baseamount*this.price)),this.$emit("kavaStake",g()(this.validators[this.validator].totalShares/this.baseamount*this.price));case 19:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),tryConnect:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return this.log(this.consoleLog,"Derivation: "+this.derivation),this.success="",this.isdelegating=!1,this.error="",this.derivationsplit=this.derivation.split("/"),this.der_network=this.derivationsplit[1],this.der_account=this.derivationsplit[2],this.der_change=this.derivationsplit[3],this.der_index=this.derivationsplit[4],e.prev=9,this.connecting=!0,e.next=13,Z.connect();case 13:e.next=23;break;case 15:return e.prev=15,e.t0=e["catch"](9),"Error: Unknown Status Code: undefined"==e.t0&&(this.error="Can't find Ledger! Please connect Ledger, enter your pin code and start Terra app. Then click connect again..."),"Error: Cosmos app does not seem to be open"==e.t0&&(this.error="Ledger app does not seem to be open"),this.log(this.consoleLog,e.t0),this.connected=!1,this.connecting=!1,e.abrupt("return");case 23:if(Z.connected){e.next=27;break}return this.connected=!1,this.log(this.consoleLog,Z.lastError),e.abrupt("return");case 27:return this.log(this.consoleLog,"Connected!"),e.prev=28,e.next=31,Z.retrieveAddress(this.der_network,this.der_account,this.der_change,this.der_index);case 31:this.myAddr=e.sent,e.next=41;break;case 34:return e.prev=34,e.t1=e["catch"](28),this.log(this.consoleLog,e.t1),"Error: Unknown Status Code: 26628"==e.t1&&(this.error="Enter Pin on Ledger"),this.connected=!1,this.connecting=!1,e.abrupt("return");case 41:return this.bech32=this.myAddr.bech32,this.pk=this.myAddr.pk,this.path=this.myAddr.path,this.log(this.consoleLog,this.myAddr),this.log(this.consoleLog,"Address  : ".concat(this.myAddr.bech32)),this.log(this.consoleLog,"PublicKey: ".concat(this.myAddr.pk)),this.log(this.consoleLog,"Query ".concat(this.myAddr.bech32)),e.next=50,Z.getAccountInfo(this.myAddr);case 50:if(this.accInfo=e.sent,!this.accInfo.error){e.next=57;break}return this.log(this.consoleLog,"getAccountInfo error"),this.log(this.consoleLog,this.accInfo.error),e.abrupt("return");case 57:this.log(this.consoleLog,this.accInfo.error),this.log(this.consoleLog,this.accInfo),this.sequence=this.accInfo.sequence,this.balance_available=te.format(g()(this.accInfo.balance/this.baseamount)),this.delegation=parseInt(this.balance_available);case 62:return e.next=64,Z.retrieveBalances([this.myAddr]);case 64:return this.reply=e.sent,e.next=67,Z.retrieveBalances([this.myAddr]);case 67:if(this.reply=e.sent,!this.reply.error){e.next=74;break}return this.log(this.consoleLog,"retrieveBalances error"),this.log(this.consoleLog,this.reply.error),e.abrupt("return");case 74:this.log(this.consoleLog,this.reply),this.balance_delegated=te.format(g()(this.reply[0].delegationsTotal/this.baseamount)),this.balance_total=te.format(g()(this.reply[0].delegationsTotal/this.baseamount).add(g()(this.accInfo.balance/this.baseamount))),this.log(this.consoleLog,this.reply[0].delegationsTotal);case 78:return e.next=80,Z.getRewards(this.myAddr);case 80:this.rewards=e.sent,this.rewards.error?(this.log(this.consoleLog,this.rewards.error),this.rewards=te.format(g()(0/this.baseamount)),this.log(this.consoleLog,"can't get rewards")):(this.log(this.consoleLog,this.rewards),this.rewards=te.format(g()(this.rewards/this.baseamount))),this.readytodelegate=!0,this.connecting=!1,this.connected=!0;case 85:case"end":return e.stop()}},e,this,[[9,15],[28,34]])}));function t(){return e.apply(this,arguments)}return t}(),delegate:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",!(this.delegation>this.balance_available)){e.next=5;break}return this.error="You cannot delegate more than available balance",this.isdelegating=!1,e.abrupt("return");case 5:if(!(this.delegation<=0)){e.next=9;break}return this.error="You need to delegate more than 0",this.isdelegating=!1,e.abrupt("return");case 9:return this.isdelegating=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=13,Z.txCreateDelegate(t,this.validator,this.delegation*this.baseamount,"Delegation to ChainLayer.io");case 13:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=16,e.next=19,Z.sign(r,t);case 19:s=e.sent,e.next=28;break;case 22:return e.prev=22,e.t0=e["catch"](16),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 28:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=30,e.next=33,Z.txSubmit(s);case 33:if(a=e.sent,!a.error){e.next=39;break}return this.error=a.error,this.log(this.consoleLog,a),this.isdelegating=!1,e.abrupt("return");case 39:e.next=47;break;case 41:return e.prev=41,e.t1=e["catch"](30),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.isdelegating=!1,e.abrupt("return");case 47:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.isdelegating=!1;case 50:case"end":return e.stop()}},e,this,[[16,22],[30,41]])}));function t(){return e.apply(this,arguments)}return t}(),withdraw:function(){var e=Object(c["a"])(regeneratorRuntime.mark(function e(){var t,r,s,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.error="",0!=g()(this.rewards)){e.next=5;break}return this.error="You need rewards to withdraw",this.iswithdrawing=!1,e.abrupt("return");case 5:return this.iswithdrawing=!0,t={chainId:this.chainId,path:this.myAddr.path,bech32:this.myAddr.bech32,pk:this.myAddr.pk},e.next=9,Z.txCreateWithdrawl(t,this.validator,"Delegation to ChainLayer.io");case 9:return r=e.sent,this.log(this.consoleLog,"Waiting for device to sign"),s="",e.prev=12,e.next=15,Z.sign(r,t);case 15:s=e.sent,e.next=24;break;case 18:return e.prev=18,e.t0=e["catch"](12),this.log(this.consoleLog,e.t0),"Error: Transaction rejected"==e.t0?this.error="Transaction rejected":"Error: Cosmos app does not seem to be open"==e.t0?this.error="Ledger App does not seem to be open":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 24:return this.log(this.consoleLog,"Broadcasting signed tx"),a="",e.prev=26,e.next=29,Z.txSubmit(s);case 29:if(a=e.sent,!a.error){e.next=35;break}return this.error=a.error,this.log(this.consoleLog,a),this.iswithdrawing=!1,e.abrupt("return");case 35:e.next=43;break;case 37:return e.prev=37,e.t1=e["catch"](26),this.log(this.consoleLog,e.t1),"Error: Transaction rejected"==e.t1?this.error="Transaction rejected":this.error="Unknown Error",this.iswithdrawing=!1,e.abrupt("return");case 43:this.success="Delegation successful! Please wait 30 seconds to refresh",this.log(this.consoleLog,a),this.iswithdrawing=!1;case 46:case"end":return e.stop()}},e,this,[[12,18],[26,37]])}));function t(){return e.apply(this,arguments)}return t}()}},se=re,ae=Object(y["a"])(se,Q,V,!1,null,null,null),ne=ae.exports,ie={name:"app",components:{IrisLedger:x,CosmosLedger:P,TerraLedger:M,KavaLedger:ne},data:function(){return{cosmosStake:g()(0),terraStake:g()(0),irisStake:g()(0),kavaStake:g()(0)}},methods:{}},oe=ie,ce=(r("034f"),Object(y["a"])(oe,a,n,!1,null,null,null)),le=ce.exports,he=r("1881"),de=r.n(he),ge=r("d0be"),ue=r.n(ge),pe=r("7bb1");s["a"].use(pe["a"]),s["a"].use(ue.a),s["a"].use(de.a),s["a"].config.productionTip=!1,new s["a"]({render:function(e){return e(le)}}).$mount("#app")},"64a9":function(e,t,r){}});
  //# sourceMappingURL=app.8d5c9784.js.map