text: (this["webpackJsonpcl-vault"]=this["webpackJsonpcl-vault"]||[]).push([[36],{1580:function(e,t,n){"use strict";n.r(t);var r=n(1),u=n.n(r),i=n(2435),o=n.n(i);function a(e,t,n,r,u,i,o){try{var a=e[i](o),c=a.value}catch(s){return void n(s)}a.done?t(c):Promise.resolve(c).then(r,u)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,u){var i=e.apply(t,n);function o(e){a(i,r,u,o,c,"next",e)}function c(e){a(i,r,u,o,c,"throw",e)}o(void 0)}))}}function s(e){return l.apply(this,arguments)}function l(){return l=c(u.a.mark((function e(t){var r,i,a,s,l,f,d,h,p,g,v,y,m,w,x,b,A,P,E,k,O,B,S,V,R,C,j,M,H,D,U,q;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q=function(){return(q=c(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==y.length){e.next=3;break}return e.next=3,k();case 3:return e.prev=3,e.abrupt("return",g.signPersonalMessage(B(),t.data));case 7:throw e.prev=7,e.t0=e.catch(3),e.t0;case 10:case"end":return e.stop()}}),e,null,[[3,7]])})))).apply(this,arguments)},U=function(e){return q.apply(this,arguments)},D=function(){return(D=c(u.a.mark((function e(t){var n,r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==y.length){e.next=3;break}return e.next=3,k();case 3:return n=i.fromTxData(t,{chain:p(f)}),e.prev=4,e.next=7,g.signTransaction(B(),n);case 7:return r=e.sent,e.abrupt("return","0x".concat(r.serialize().toString("hex")));case 11:throw e.prev=11,e.t0=e.catch(4),e.t0;case 14:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)},H=function(e){return D.apply(this,arguments)},M=function(e){return new Promise((function(t,n){x.sendAsync({jsonrpc:"2.0",method:"eth_getBalance",params:[e,"latest"],id:42},(function(e,r){e&&n(e);var u=r&&r.result;t(null!=u?new h(u).toString(10):null)}))}))},j=function(e){return Promise.all(e.map((function(e){return new Promise(function(){var t=c(u.a.mark((function t(n){var r;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M(e);case 2:r=t.sent,n({address:e,balance:r});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})))},C=function(){return(C=c(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m){e.next=2;break}return e.abrupt("return",[]);case 2:if(!(g.getAccounts().length>0)||t){e.next=4;break}return e.abrupt("return",g.getAccounts());case 4:return e.prev=4,e.next=7,g.addAccounts(g.getAccounts().length+5);case 7:y=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),e.t0;case 13:return e.abrupt("return",y);case 14:case"end":return e.stop()}}),e,null,[[4,10]])})))).apply(this,arguments)},R=function(e){return C.apply(this,arguments)},V=function(){return(V=c(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R(!0);case 2:return t=e.sent,e.abrupt("return",t&&j(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},S=function(){return V.apply(this,arguments)},B=function(){return g.getCurrentAddress()},O=function(e){return g.setCurrentAccount(y.findIndex((function(t){return t===e}))||0)},k=function(){return m?R():g.readKeyring().then((function(){return m=!0,R()}))},E=function(){return w},P=function(){return(P=c(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===l){e.next=2;break}throw new Error("CoboVault only supports standard path: m/44'/0'/0'/0/x");case 2:return w=!1,v=t,e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},A=function(e){return P.apply(this,arguments)},b=function(){v="",m=!1,x.stop()},e.next=19,Promise.resolve().then(n.t.bind(null,608,7));case 19:return r=e.sent,i=r.Transaction,e.next=23,Promise.all([n.e(1),n.e(2),n.e(3),n.e(4)]).then(n.bind(null,1683));case 23:return a=e.sent,s=a.default,l="m/44'/60'/0'/0",f=t.networkId,d=t.rpcUrl,h=t.BigNumber,p=t.networkName,g=o.a.getEmptyKeyring(),v="",y=Array.from([]),m=!1,w=!1,(x=s({getAccounts:function(e){R().then((function(t){return e(null,t)})).catch((function(t){return e(t,null)}))},signTransaction:function(e,t){H(e).then((function(e){return t(null,e)})).catch((function(e){return t(e,null)}))},processMessage:function(e,t){U(e).then((function(e){return t(null,e)})).catch((function(e){return t(e,null)}))},processPersonalMessage:function(e,t){U(e).then((function(e){return t(null,e)})).catch((function(e){return t(e,null)}))},signMessage:function(e,t){U(e).then((function(e){return t(null,e)})).catch((function(e){return t(e,null)}))},signPersonalMessage:function(e,t){U(e).then((function(e){return t(null,e)})).catch((function(e){return t(e,null)}))},rpcUrl:d})).setPath=A,x.dPath=v,x.enable=k,x.setPrimaryAccount=O,x.getPrimaryAddress=B,x.getAccounts=R,x.getMoreAccounts=S,x.getBalance=M,x.getBalances=j,x.send=x.sendAsync,x.disconnect=b,x.isCustomPath=E,e.abrupt("return",x);case 46:case"end":return e.stop()}}),e)}))),l.apply(this,arguments)}t.default=function(e){var t=e.appName,n=e.rpcUrl,r=e.networkId,i=e.preferred,o=e.label,a=e.iconSrc;return{name:o||"CoboVault",svg:e.svg,iconSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAMLUlEQVR4nO2ceVQV9xXHP/N47IhsouhJNKhI0IASxCUYVNwitFqbrUl7amKaQ9SYqMEVjZpEiZ6aRlPT1jQ5bdPkJM12TI2JqdEoLrhgUEBEgwsYxQ1FEGSb/vF4w5s3M2/mASIB5hycH7/f7/u7dz5z79x58xiFe2KfFJFtos1OVPYj2nSrjNvoRLU5musCoka/qs3G6uzWMHgsWjZNyLYOeM7AA9EWYAc8Z+EBmI0JmwBPVDnwOwnPkU7aGYMnAmZ1oTMOyRfUPAEOHTJis/XBa0hhhdCoQ8oFldpWAk/LD6fg2Y5YU/h2pG1rhGfwWLRtqhyr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GTa68lG1U0vfQHaBILtX3qnLlmwOFXAqEh8pV7yJ6DPtDd4AHyqVZU1auysHOrFwWXDem+nWwJ6Cuj01duRr7Io7RpVx9+8/w03bKoMrK9Qa5waRclRgfKVcwjbVoFRCa77VhmRbelMh1+5wrVb377/ig/oZ/6JZfwCpXMO03/GW+b4dlWnhTIlefyOiYUof+hn/oxkEAK1dah7zhH7rl5ydytXA923/Z+8Eh5fqLXG8rV/BFPxDtD+V6SC7RdJCQ64OD20hP9mYolxbelMjVgcGMSZYpfpWhb5XLghvM5MpqeoSpiCZyFW74N0pyWdrVheks86NyNWjXgUkpU3rozrfkypNgqKNzzmnc5MpLdYxKOpUr2P8DZztj6pDjDvgAAAAASUVORK5CYII=",wallet:function(){var e=c(u.a.mark((function e(i){var o,a,l,f;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.BigNumber,a=i.networkName,l=i.resetWalletState,e.next=3,s({appName:t,rpcUrl:n,networkId:r,BigNumber:o,networkName:a,resetWalletState:l});case 3:return f=e.sent,e.abrupt("return",{provider:f,interface:{name:"CoboVault",connect:f.enable,disconnect:f.disconnect,address:{get:function(){var e=c(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",f.getPrimaryAddress());case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},network:{get:function(){var e=c(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},balance:{get:function(){var e=c(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.getPrimaryAddress(),e.abrupt("return",t&&f.getBalance(t));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),type:"hardware",desktop:!0,mobile:!0,osExclusions:[],preferred:i}}},1984:function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBc32Data=t.encodeBc32Data=t.encodeSegwitAddress=t.decodeSegwitAddress=t.Bech32Version=void 0;var u,i=r(n(2442));!function(e){e[e.Origin=1]="Origin",e[e.bis=2]="bis"}(u=t.Bech32Version||(t.Bech32Version={}));var o=function(e,t,n,r){for(var u=0,i=0,o=[],a=(1<<n)-1,c=0;c<e.length;++c){var s=e[c];if(s<0||s>>t!==0)return null;for(u=u<<t|s,i+=t;i>=n;)i-=n,o.push(u>>i&a)}if(r)i>0&&o.push(u<<n-i&a);else if(i>=t||u<<n-i&a)return null;return o};t.decodeSegwitAddress=function(e,t){var n=i.default.decode(t);if(null===n||n.hrp!==e||n.data.length<1||n.data[0]>16)return null;var r=o(Uint8Array.from(n.data.slice(1)),5,8,!1);return null===r||r.length<2||r.length>40||0===n.data[0]&&20!==r.length&&32!==r.length?null:{version:n.data[0],program:r}};t.encodeSegwitAddress=function(e,n,r){var a=o(r,8,5,!0);if(!a)return null;var c=i.default.encode(e,[n].concat(a),u.Origin);return null===t.decodeSegwitAddress(e,c)?null:c};t.encodeBc32Data=function(t){var n=e.from(t,"hex"),r=o(n,8,5,!0);if(r)return i.default.encode(void 0,r,u.bis);throw new Error("invalid input")};t.decodeBc32Data=function(t){var n=i.default.decode(t);if(n){var r=o(e.from(n.data),5,8,!1);return r?e.from(r).toString("hex"):null}return null}}).call(this,n(20).Buffer)},2124:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u,i,o=r(n(61)),a=r(n(2437)),c=r(n(0)),s=r(n(1967)),l=!1;t.default={bootstrap:function(){var e=document.getElementsByTagName("body").item(0),t=document.createElement("div");t.id="cv_sdk_container",e.appendChild(t),s.default.setAppElement("#cv_sdk_container"),o.default.render(c.default.createElement(a.default),t)},setup:function(e,t){l=!0,u=e,i=t},makeService:function(){if(l)return{read:u,play:i};throw new Error("SDK is not initialized")}}},2125:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractSingleWorkload=t.decodeUR=t.encodeUR=void 0;var r=n(2441);Object.defineProperty(t,"encodeUR",{enumerable:!0,get:function(){return r.encodeUR}});var u=n(2443);Object.defineProperty(t,"decodeUR",{enumerable:!0,get:function(){return u.decodeUR}}),Object.defineProperty(t,"extractSingleWorkload",{enumerable:!0,get:function(){return u.extractSingleWorkload}})},2126:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSimpleCBOR=t.encodeSimpleCBOR=t.composeHeader=void 0;t.composeHeader=function(t){var n;if(t>0&&t<=23)n=e.from([64+t]);else if(t>=24&&t<=255){(r=e.alloc(1)).writeUInt8(t,0),n=e.concat([e.from([88]),r])}else if(t>=256&&t<=65535){(r=e.alloc(2)).writeUInt16BE(t,0),n=e.concat([e.from([89]),r])}else{if(!(t>=65536&&t<=Math.pow(2,32)-1))throw new Error("length exceeded");var r;(r=e.alloc(4)).writeUInt32BE(t,0),n=e.concat([e.from([96]),r])}return n};t.encodeSimpleCBOR=function(n){var r=e.from(n,"hex");if(r.length<=0||r.length>=Math.pow(2,32))throw new Error("data is too large");var u=t.composeHeader(r.length);return e.concat([u,r]).toString("hex")};t.decodeSimpleCBOR=function(t){var n=e.from(t,"hex");if(n.length<=0)throw new Error("invalid input");var r=n[0];if(r<88){var u=r-64;return n.slice(1,1+u).toString("hex")}if(88==r){u=n.slice(1,2).readUInt8(0);return n.slice(2,2+u).toString("hex")}if(89==r){u=n.slice(1,3).readUInt16BE(0);return n.slice(3,3+u).toString("hex")}if(96==r){u=n.slice(1,5).readUInt32BE(0);return n.slice(5,5+u).toString("hex")}throw new Error("invalid input")}}).call(this,n(20).Buffer)},2127:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compose3=t.sha256Hash=void 0;var u=r(n(494));t.sha256Hash=function(e){return u.default("sha256").update(e).digest()};t.compose3=function(e,t,n){return function(r){return e(t(n(r)))}}},2128:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Button=void 0;var u=r(n(0)),i={minWidth:64,height:24,background:"transparent",borderColor:"grey",borderWidth:1,outline:"none",margin:2};t.Button=function(e){var t=e.onClick,n=e.children;return u.default.createElement("button",{onClick:t,style:i},n)}},2129:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonGroup=void 0;var u=r(n(0));t.ButtonGroup=function(e){return u.default.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row-reverse",alignItems:"center",justifyContent:"flex-start"}},e.children)}},2435:function(e,t,n){"use strict";(function(e){var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(u,i){function o(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?u(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,u,i,o={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(u=2&i[0]?r.return:i[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,i[1])).done)return u;switch(r=0,u&&(i=[2&i[0],u.value]),i[0]){case 0:case 1:u=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(u=(u=o.trys).length>0&&u[u.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!u||i[1]>u[0]&&i[1]<u[3])){o.label=i[1];break}if(6===i[0]&&o.label<u[1]){o.label=u[1],u=i;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(i);break}u[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(a){i=[6,a],r=0}finally{n=u=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},o=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,u=e.length;n<r;n++,u++)e[u]=t[n];return e},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=n(164),s=a(n(84)),l=a(n(1825)),f=a(n(2436)),d=n(87),h="Air Gaped Device",p=function(){return u(void 0,void 0,void 0,(function(){var e,t,n,r,u,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,f.default.read({title:"Sync Cobo Vault",description:"Please click 'Sync' in Cobo Vault and scan the QR code displayed later"})];case 1:if(e=i.sent(),t=e.type,n=e.result,"json"===t){if(r=JSON.parse(n),u=r.xfp,o=r.xpub,a=r.path,u&&o&&a)return[2,{xfp:u,xpub:o,hdPath:a}]}else if("none"===t)throw new Error("Reading canceled");throw new Error("Invalid qrcode")}}))}))},g=function(t){function n(e){var n=t.call(this)||this;return n.xfp="",n.xpub="",n.hdPath="",n.page=0,n.perPage=5,n.type=h,n.accounts=[],n.currentAccount=0,n.paths={},n.latestAccount=0,n.deserialize(e),n}return r(n,t),n.getKeyring=function(){return u(this,void 0,void 0,(function(){var e,t,r,u;return i(this,(function(i){switch(i.label){case 0:return[4,p()];case 1:return e=i.sent(),t=e.xpub,r=e.xfp,u=e.hdPath,[2,new n({xfp:r,xpub:t,hdPath:u,perPage:5,page:0,accounts:[],currentAccount:0,paths:{}})]}}))}))},n.getEmptyKeyring=function(){return new n({xfp:"",xpub:"",hdPath:"",perPage:5,page:0,accounts:[],currentAccount:0,paths:{}})},n.prototype.readKeyring=function(){return u(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(u){switch(u.label){case 0:return[4,p()];case 1:return e=u.sent(),t=e.xpub,n=e.xfp,r=e.hdPath,this.xfp=n,this.xpub=t,this.hdPath=r,[2]}}))}))},n.prototype.checkKeyring=function(){if(!this.xfp||!this.xpub||!this.hdPath)throw new Error("keyring not fulfilled, please call function `readKeyring` firstly")},n.prototype.serialize=function(){return Promise.resolve({xfp:this.xfp,xpub:this.xpub,hdPath:this.hdPath,accounts:this.accounts,currentAccount:this.currentAccount,page:this.page,perPage:this.perPage,paths:this.paths})},n.prototype.deserialize=function(e){this.xfp=e.xfp,this.xpub=e.xpub,this.hdPath=e.hdPath,this.accounts=e.accounts,this.currentAccount=e.currentAccount,this.page=e.page,this.perPage=e.perPage,this.paths=e.paths},n.prototype.setCurrentAccount=function(e){this.currentAccount=e},n.prototype.getCurrentAccount=function(){return this.currentAccount},n.prototype.getCurrentAddress=function(){return this.accounts[this.currentAccount]},n.prototype.addAccounts=function(e){var t=this;return void 0===e&&(e=1),new Promise((function(n,r){try{for(var u=t.latestAccount,i=u+e,o=[],a=u;a<i;a++){var c=t._addressFromIndex("m",a);o.push(c),t.page=0,t.latestAccount++}t.accounts=t.accounts.concat(o),n(t.accounts)}catch(s){r(s)}}))},n.prototype.getFirstPage=function(){return this.page=0,this.__getPage(1)},n.prototype.getNextPage=function(){return this.__getPage(1)},n.prototype.getPreviousPage=function(){return this.__getPage(-1)},n.prototype.__getPage=function(e){var t=this;return this.page+=e,this.page<=0&&(this.page=1),new Promise((function(e,n){try{for(var r=(t.page-1)*t.perPage,u=r+t.perPage,i=[],o=r;o<u;o++){var a=t._addressFromIndex("m",o);i.push({address:a,balance:null,index:o}),t.paths[d.toChecksumAddress(a)]=o}e(i)}catch(c){n(c)}}))},n.prototype.getAccounts=function(){return this.accounts},n.prototype.removeAccount=function(e){if(!this.accounts.map((function(e){return e.toLowerCase()})).includes(e.toLowerCase()))throw new Error("Address "+e+" not found in this keyring");this.accounts=this.accounts.filter((function(t){return t.toLowerCase()!==e.toLowerCase()}))},n.prototype.readSignature=function(t){return u(this,void 0,void 0,(function(){var n,r,u,o,a,c,s;return i(this,(function(i){switch(i.label){case 0:return[4,f.default.read({title:"Submit signing result",description:"Please scan signing result QR code displayed on your Cobo Vault"})];case 1:if(n=i.sent()){if("ur"===n.type){if(r=JSON.parse(e.from(n.result,"hex").toString("utf-8")),u=r.signId,o=r.signature,u&&o){if(u!==t)throw new Error("read signature error: mismatched signId");return a=e.from(o.slice(0,64),"hex"),c=e.from(o.slice(64,128),"hex"),s=e.from(o.slice(128),"hex"),[2,{r:a,s:c,v:s}]}throw new Error("invalid signature qrcode")}throw new Error("invalid signature qrcode")}throw new Error("read signature canceled")}}))}))},n.serializeTx=function(e){var t=o(o([],e.raw.slice(0,6)),[d.toBuffer(e.getChainId()),d.unpadBuffer(d.toBuffer(0)),d.unpadBuffer(d.toBuffer(0))]);return d.rlp.encode(t)},n.prototype.signTransaction=function(t,r){return u(this,void 0,void 0,(function(){var u,o,a,c,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:return u=n.serializeTx(r).toString("hex"),o=this._pathFromAddress(t),a=s.default.sha256().update(""+u+o+this.xfp).digest("hex").slice(0,8),c={txHex:u,xfp:this.xfp,hdPath:o,signId:a},[4,f.default.play(e.from(JSON.stringify(c),"utf-8").toString("hex"),{hasNext:!0,title:"Request signing transaction",description:"Please scan the QR code below with Cobo Vault, review transaction information and authorize to sign"})];case 1:return i.sent(),[4,this.readSignature(a)];case 2:return l=i.sent(),d=l.r,h=l.s,p=l.v,r.r=d,r.s=h,r.v=p,[2,r]}}))}))},n.prototype.signMessage=function(e,t){return this.signPersonalMessage(e,t)},n.prototype.signPersonalMessage=function(t,n){return u(this,void 0,void 0,(function(){var r,u,o,a,c,l,d;return i(this,(function(i){switch(i.label){case 0:return r=this._pathFromAddress(t),u=s.default.sha256().update(""+n+r+this.xfp).digest("hex").slice(0,8),o={messageHex:n,xfp:this.xfp,hdPath:r,signId:u},[4,f.default.play(e.from(JSON.stringify(o),"utf-8").toString("hex"),{hasNext:!0,title:"Request signing message",description:"Please scan the QR code below with Cobo Vault, review message and authorize to sign"})];case 1:return i.sent(),[4,this.readSignature(u)];case 2:return a=i.sent(),c=a.r,l=a.s,d=a.v,[2,"0x"+c+l+d]}}))}))},n.prototype.signTypedData=function(t,n){return u(this,void 0,void 0,(function(){var r,u,o,a,c,l,d;return i(this,(function(i){switch(i.label){case 0:return r=this._pathFromAddress(t),u=s.default.sha256().update(""+JSON.stringify(n)+r+this.xfp).digest("hex").slice(0,8),o={data:n,xfp:this.xfp,hdPath:r,signId:u},[4,f.default.play(e.from(JSON.stringify(o),"utf-8").toString("hex"),{hasNext:!0,title:"Request signing typed data",description:"Please scan the QR code below with Cobo Vault, review data and authorize to sign"})];case 1:return i.sent(),[4,this.readSignature(u)];case 2:return a=i.sent(),c=a.r,l=a.s,d=a.v,[2,e.concat([c,l,d])]}}))}))},n.prototype._addressFromIndex=function(e,t){this.checkKeyring(),this.hdk||(this.hdk=l.default.fromExtendedKey(this.xpub));var n=this.hdk.derive(e+"/0/"+t),r="0x"+d.publicToAddress(n.publicKey,!0).toString("hex");return d.toChecksumAddress(r)},n.prototype._pathFromAddress=function(e){var t=d.toChecksumAddress(e),n=this.paths[t];if("undefined"===typeof n)for(var r=0;r<1e3;r++)if(t===this._addressFromIndex("m",r)){n=r;break}if("undefined"===typeof n)throw new Error("Unknown address");return this.hdPath+"/0/"+n},n.type=h,n}(c.EventEmitter);t.default=g}).call(this,n(20).Buffer)},2436:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=r(n(2124));u.default.bootstrap(),t.default=u.default.makeService()},2437:function(e,t,n){"use strict";var r=n(130).default,u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=u(n(2124)),o=n(2438);t.default=function(){var e=o.useController(),t=r(e,2),n=t[0],u=t[1],a=u.read,c=u.play;return i.default.setup(a,c),n}},2438:function(e,t,n){"use strict";var r=n(1),u=n(130).default,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},c=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(u,i){function o(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?u(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useController=void 0;var l=a(n(0)),f=s(n(1967)),d=n(2439),h=n(2444),p={content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)"}};t.useController=function(){var e=l.useState(!1),t=u(e,2),n=t[0],i=t[1],o=l.useState("play"),a=u(o,2),s=a[0],g=a[1],v=d.useAnimatedQRCodePlayer(),y=u(v,2),m=y[0],w=y[1].play,x=h.useAnimatedQRCodeReader(),b=u(x,2),A=b[0],P=b[1].read,E=function(){i(!1),g("play")};return[l.default.createElement(f.default,{isOpen:n,style:p},l.default.createElement("div",{style:{width:320,boxSizing:"border-box",padding:16,flex:1,flexDirection:"column",alignItems:"center",justifyContent:"center"}},"read"===s?A:m)),{play:function(e,t){return c(void 0,void 0,void 0,r.mark((function n(){return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i(!0),g("play"),n.next=4,w(e,t);case 4:return E(),n.abrupt("return");case 6:case"end":return n.stop()}}),n)})))},read:function(e){return c(void 0,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i(!0),g("read"),t.next=4,P(e);case 4:return n=t.sent,E(),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t)})))}}]}},2439:function(e,t,n){"use strict";var r=n(130).default,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&u(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useAnimatedQRCodePlayer=void 0;var a=o(n(0)),c=n(1723),s=n(2440),l=n(2125),f=n(164),d=n(2128),h=n(2129);t.useAnimatedQRCodePlayer=function(){var e=a.useState([]),t=r(e,2),n=t[0],u=t[1],i=a.useState(500),o=r(i,2),p=o[0],g=o[1],v=a.useState(!1),y=r(v,2),m=y[0],w=y[1],x=a.useState(0),b=r(x,2),A=b[0],P=b[1],E=a.useState(null),k=r(E,2),O=k[0],B=k[1],S=a.useState(null),V=r(S,2),R=V[0],C=V[1],j=a.useState(!1),M=r(j,2),H=M[0],D=M[1],U=function(){P((function(e){return e>=I.length-1?0:e+1}))},q=a.useMemo((function(){return new f.EventEmitter}),[]),I=n;a.useEffect((function(){if(!H){var e=c.interval(p).subscribe((function(){U()}));return function(){e.unsubscribe()}}}),[p,I,H]);var z=a.default.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},O&&a.default.createElement("p",null,O),R&&a.default.createElement("p",null,R),a.default.createElement(s.BaseQRCode,{size:288,data:I[A]}),a.default.createElement("p",{style:{textAlign:"center"}},A+1,"/",I.length),a.default.createElement(h.ButtonGroup,null,H?a.default.createElement(d.Button,{onClick:function(){D(!1)}},"Play"):a.default.createElement(d.Button,{onClick:function(){D(!0)}},"Pause"),a.default.createElement(d.Button,{onClick:U},"Next"),a.default.createElement(d.Button,{onClick:function(){P((function(e){return e<0?I.length-1:e-1}))}},"Prev")),a.default.createElement(h.ButtonGroup,null,a.default.createElement(d.Button,{onClick:function(){q.emit("finish",!0)}},m?"Next":"Finish")));return[z,{play:function(e,t){return new Promise((function(n){var r=l.encodeUR(e,800);u(r),t&&(t.refreshSpeed&&g(t.refreshSpeed),t.hasNext&&w(t.hasNext),t.title&&B(t.title),t.description&&C(t.description)),q.once("finish",(function(){u([]),g(500),P(0),n()}))}))}}]}},2440:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseQRCode=void 0;var u=r(n(0)),i=r(n(633));t.BaseQRCode=function(e){var t=e.size,n=void 0===t?200:t,r=e.data,o=void 0===r?"":r,a=e.ecl,c=void 0===a?"L":a;return u.default.createElement(i.default,{value:o,size:n,level:c})}},2441:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeUR=void 0;var r=n(2126),u=n(1984),i=n(2127),o=function(e,t){return void 0===t&&(t="bytes"),"ur:"+t+"/"+e};t.encodeUR=function(t,n){void 0===n&&(n=200);var a=r.encodeSimpleCBOR(t),c=u.encodeBc32Data(a),s=i.sha256Hash(e.from(a,"hex")).toString("hex"),l=u.encodeBc32Data(s),f=c.match(new RegExp(".{1,"+n+"}","g"));if(!f)throw new Error("Unexpected error when encoding");return function(e,t,n){return void 0===n&&(n="bytes"),1===e.length?[o(e[0])]:e.map((function(r,u){return i.compose3((function(e){return o(e,n)}),(function(t){return function(e,t,n){return t+1+"of"+n+"/"+e}(t,u,e.length)}),(function(e){return function(e,t){return t+"/"+e}(e,t)}))(r)}))}(f,l,"bytes").map((function(e){return e.toUpperCase()}))}}).call(this,n(20).Buffer)},2442:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1984),u="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i=[996825010,642813549,513874426,1027748829,705979059],o=function(e){for(var t=1,n=0;n<e.length;++n){var r=t>>25;t=(33554431&t)<<5^e[n];for(var u=0;u<6;++u)r>>u&1&&(t^=i[u])}return t},a=function(e){var t,n=[];for(t=0;t<e.length;++t)n.push(e.charCodeAt(t)>>5);for(n.push(0),t=0;t<e.length;++t)n.push(31&e.charCodeAt(t));return n},c=function(e,t,n){var u;u=e?a(e):[0];var i=n===r.Bech32Version.Origin?1:1073741823;return o(u.concat(t))===i};t.default={encode:function(e,t,n){var i,c=t.concat(function(e,t,n){var u;u=e?a(e).concat(t).concat([0,0,0,0,0,0]):[0].concat(t).concat([0,0,0,0,0,0]);for(var i=n===r.Bech32Version.Origin?1:1073741823,c=o(u)^i,s=[],l=0;l<6;++l)s.push(c>>5*(5-l)&31);return s}(e,t,n));i=e?e+"1":"";for(var s=0;s<c.length;++s)i+=u.charAt(c[s]);return i},decode:function(e){var t,n=!1,i=!1;for(t=0;t<e.length;++t){if(e.charCodeAt(t)<33||e.charCodeAt(t)>126)return null;e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122&&(n=!0),e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90&&(i=!0)}if(n&&i)return null;var o=(e=e.toLowerCase()).lastIndexOf("1");if(-1===o)return function(e){for(var t=[],n=0;n<e.length;++n){var i=u.indexOf(e.charAt(n));if(-1===i)return null;t.push(i)}return c(void 0,t,r.Bech32Version.bis)?{hrp:null,data:t.slice(0,t.length-6)}:null}(e);if(o<1||o+7>e.length||e.length>90)return null;var a=e.substring(0,o),s=[];for(t=o+1;t<e.length;++t){var l=u.indexOf(e.charAt(t));if(-1===l)return null;s.push(l)}return c(a,s,r.Bech32Version.Origin)?{hrp:a,data:s.slice(0,s.length-6)}:null}}},2443:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.extractSingleWorkload=t.smartDecodeUR=t.decodeUR=void 0;var r=n(2127),u=n(2126),i=n(1984),o=function(e){var t=e.toUpperCase().split("OF");if(2!==t.length)throw new Error("invalid sequence: "+e);return[+t[0],+t[1]]},a=function(t,n){var u=i.decodeBc32Data(n);if(!u)throw new Error("can not decode payload: "+n);if(i.decodeBc32Data(t)!==r.sha256Hash(e.from(u,"hex")).toString("hex"))throw new Error("invalid digest: \n digest:"+t+" \n payload:"+n)},c=function(e,t){if(void 0===t&&(t="bytes"),e.toUpperCase()!==("ur:"+t).toUpperCase())throw new Error("invalid UR header: "+e)},s=function(e,t){void 0===t&&(t="bytes");try{return 1===e.length?function(e,t){void 0===t&&(t="bytes");var n=e.split("/");switch(n.length){case 2:return c(n[0],t),n[1];case 3:c(n[0],t);var r=n[1],u=n[2];return a(r,u),u;case 4:return c(n[0],t),o(n[1]),r=n[2],u=n[3],a(r,u),u;default:throw new Error("invalid workload pieces length: expect 2 / 3 / 4 bug got "+n.length)}}(e[0],t):function(e,t){void 0===t&&(t="bytes");var n=e.length,r=new Array(n).fill(""),u="";e.forEach((function(e){var i=e.split("/");c(i[0],t);var a=o(i[1]),s=a[0],l=a[1];if(l!==n)throw new Error("invalid workload: "+e+", total "+l+" not equal workloads length "+n);if(u&&u!==i[2])throw new Error("invalid workload: "+e+", checksum changed "+u+", "+i[2]);if(u=i[2],r[s-1])throw new Error("invalid workload: "+e+", index "+s+" has already been set");r[s-1]=i[3]}));var i=r.join("");return a(u,i),i}(e,t)}catch(n){throw new Error("invalid workloads: "+e+"\n "+n)}};t.decodeUR=function(e,t){void 0===t&&(t="bytes");var n=s(e,t),r=i.decodeBc32Data(n);if(!r)throw new Error("invalid data");return u.decodeSimpleCBOR(r)};var l=function(e,t,n){return n.indexOf(e)===t};t.smartDecodeUR=function(e){if(e.length>0){var n=t.extractSingleWorkload(e[0]),r=(n[0],n[1]);return e.length===r?{success:!0,current:e.length,length:r,workloads:[],result:t.decodeUR(e)}:{success:!1,current:e.length,length:r,workloads:e.filter(l),result:""}}return{success:!1,current:0,length:0,workloads:[],result:""}};t.extractSingleWorkload=function(e){var t=e.toUpperCase().split("/");switch(t.length){case 2:case 3:return[1,1];case 4:return o(t[1]);default:throw new Error("invalid workload pieces length: expect 2 / 3 / 4 bug got "+t.length)}}}).call(this,n(20).Buffer)},2444:function(e,t,n){"use strict";var r=n(191).default,u=n(130).default,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useAnimatedQRCodeReader=void 0;var s=a(n(0)),l=c(n(1709)),f=n(2125),d=n(164),h=n(2128),p=n(2445),g=n(2129);t.useAnimatedQRCodeReader=function(){var e=s.useState([]),t=u(e,2),n=t[0],i=t[1],o=s.useState(""),a=u(o,2),c=a[0],v=a[1],y=s.useMemo((function(){return new d.EventEmitter}),[]),m=s.useState(null),w=u(m,2),x=w[0],b=w[1],A=s.useState(null),P=u(A,2),E=P[0],k=P[1],O=function(){i([]),v("")},B=function(e){JSON.parse(e),y.emit("read",{type:"json",result:e})},S=function(e){y.emit("read",{type:"text",result:e})},V=function(e){try{var t=f.extractSingleWorkload(e),o=u(t,2),a=o[0],c=o[1];if(n.length>0)c!==n[0].total&&v("invalid animated qrcode: mismatching qrs, please retry");if(!n.find((function(e){return e.index===a}))){var s=[].concat(r(n),[{index:a,total:c,data:e}]);if(i(s),s.length===c){var l=f.decodeUR(s.map((function(e){return e.data})));y.emit("read",{type:"ur",result:l})}}}catch(d){v(d.message)}};return[s.default.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},x&&s.default.createElement("p",null,x),E&&s.default.createElement("p",null,E),s.default.createElement(l.default,{onScan:function(e){e&&function(e){try{B(e)}catch(t){try{V(e)}catch(n){S(e)}}}(e)},delay:100,style:{width:"100%"},onError:function(e){v(e.message)}}),s.default.createElement("p",null,n[0]&&n[0].total>1&&s.default.createElement(p.Progress,{progress:n.length,total:n[0].total})),s.default.createElement(g.ButtonGroup,null,s.default.createElement(h.Button,{onClick:function(){y.emit("read",{type:"none",result:""})}},"Close"),c&&s.default.createElement(h.Button,{onClick:function(){O()}},"Retry")),c&&s.default.createElement("p",{style:{color:"red"}},c)),{read:function(e){return new Promise((function(t){console.log(e),e&&(e.title&&b(e.title),e.description&&k(e.description)),y.once("read",(function(e){O(),t(e)}))}))}}]}},2445:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Progress=void 0;var u=r(n(0));t.Progress=function(e){var t=e.progress,n=e.total;return u.default.createElement("p",null,"".concat(t," / ").concat(n))}}}]);
  //# sourceMappingURL=36.31213dba.chunk.js.map