From 84f22b68300f70aa01458c84723fd75c3f375d30 Mon Sep 17 00:00:00 2001 From: Angela Date: Wed, 9 Mar 2022 10:13:20 -0500 Subject: [PATCH] Add files via upload --- terraConnectr/DESCRIPTION | 20 ++++++++++ terraConnectr/NAMESPACE | 6 +++ terraConnectr/R/terraConnect.R | 24 ++++++++++++ .../terraConnect/terraConnect.js | 39 +++++++++++++++++++ .../terraConnect/terraConnect.js.map | 1 + terraConnectr/man/terraConnect.Rd | 11 ++++++ 6 files changed, 101 insertions(+) create mode 100644 terraConnectr/DESCRIPTION create mode 100644 terraConnectr/NAMESPACE create mode 100644 terraConnectr/R/terraConnect.R create mode 100644 terraConnectr/inst/www/terraConnectr/terraConnect/terraConnect.js create mode 100644 terraConnectr/inst/www/terraConnectr/terraConnect/terraConnect.js.map create mode 100644 terraConnectr/man/terraConnect.Rd diff --git a/terraConnectr/DESCRIPTION b/terraConnectr/DESCRIPTION new file mode 100644 index 0000000..f34b0d8 --- /dev/null +++ b/terraConnectr/DESCRIPTION @@ -0,0 +1,20 @@ +Package: terraConnectr +Title: What the Package Does (One Line, Title Case) +Version: 0.0.0.9000 +Authors@R: + person(given = "First", + family = "Last", + role = c("aut", "cre"), + email = "first.last@example.com", + comment = c(ORCID = "YOUR-ORCID-ID")) +Description: What the package does (one paragraph). +License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a + license +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.1.1 +Imports: htmltools, reactR, shiny +NeedsCompilation: no +Packaged: 2022-01-20 14:34:14 UTC; angelaminster +Author: First Last [aut, cre] (YOUR-ORCID-ID) +Maintainer: First Last diff --git a/terraConnectr/NAMESPACE b/terraConnectr/NAMESPACE new file mode 100644 index 0000000..113a184 --- /dev/null +++ b/terraConnectr/NAMESPACE @@ -0,0 +1,6 @@ +# Generated by roxygen2: do not edit by hand + +export(terraConnect) +importFrom(htmltools,htmlDependency) +importFrom(htmltools,tags) +importFrom(reactR,createReactShinyInput) diff --git a/terraConnectr/R/terraConnect.R b/terraConnectr/R/terraConnect.R new file mode 100644 index 0000000..b2b8c8a --- /dev/null +++ b/terraConnectr/R/terraConnect.R @@ -0,0 +1,24 @@ +#' +#' +#' +#' +#' @importFrom reactR createReactShinyInput +#' @importFrom htmltools htmlDependency tags +#' +#' @export +terraConnect <- function(inputId) { + reactR::createReactShinyInput( + inputId, + "terraConnect", + htmltools::htmlDependency( + name = "terraConnect-input", + version = "1.0.0", + src = "www/terraConnectr/terraConnect", + package = "terraConnectr", + script = "terraConnect.js" + ), + default = 0, + list(), + htmltools::tags$div + ) +} diff --git a/terraConnectr/inst/www/terraConnectr/terraConnect/terraConnect.js b/terraConnectr/inst/www/terraConnectr/terraConnect/terraConnect.js new file mode 100644 index 0000000..1f7b238 --- /dev/null +++ b/terraConnectr/inst/www/terraConnectr/terraConnect/terraConnect.js @@ -0,0 +1,39 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=892)}([function(e,t,n){var r=n(13),o=n(54),i=n(40),a=n(41),s=n(55),u=function e(t,n,u){var c,l,d,f,p=t&e.F,h=t&e.G,v=t&e.P,m=t&e.B,g=h?r:t&e.S?r[n]||(r[n]={}):(r[n]||{}).prototype,b=h?o:o[n]||(o[n]={}),y=b.prototype||(b.prototype={});for(c in h&&(u=n),u)d=((l=!p&&g&&void 0!==g[c])?g:u)[c],f=m&&l?s(d,r):v&&"function"==typeof d?s(Function.call,d):d,g&&a(g,c,d,t&e.U),b[c]!=d&&i(b,c,f),v&&y[c]!=d&&(y[c]=d)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n>>=0)&&e<256)&&(r=a[e])?r:(n=c(e,(0|e)<0?-1:0,!0),o&&(a[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(r=i[e])?r:(n=c(e,e<0?-1:0,!1),o&&(i[e]=n),n)}function u(e,t){if(isNaN(e))return t?b:g;if(t){if(e<0)return b;if(e>=h)return O}else{if(e<=-v)return k;if(e+1>=v)return _}return e<0?u(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=s,r.fromNumber=u,r.fromBits=c;var l=Math.pow;function d(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return d(e.substring(1),t,n).neg();for(var o=u(l(n,8)),i=g,a=0;a>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},A.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(k)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},A.isOdd=function(){return 1==(1&this.low)},A.isEven=function(){return 0==(1&this.low)},A.equals=function(e){return o(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(e){return this.comp(e)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return this.comp(e)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(e){return this.comp(e)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return this.comp(e)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(e){if(o(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(k)?k:this.not().add(y)},A.neg=A.negate,A.add=function(e){o(e)||(e=f(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,d=0,p=0,h=0;return p+=(h+=i+(65535&e.low))>>>16,d+=(p+=r+u)>>>16,l+=(d+=n+s)>>>16,l+=t+a,c((p&=65535)<<16|(h&=65535),(l&=65535)<<16|(d&=65535),this.unsigned)},A.subtract=function(e){return o(e)||(e=f(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=f(e)),n)return c(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(k))return e.isOdd()?k:g;if(e.eq(k))return this.isOdd()?k:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,l=65535&e.high,d=e.low>>>16,p=65535&e.low,h=0,v=0,b=0,y=0;return b+=(y+=a*p)>>>16,v+=(b+=i*p)>>>16,b&=65535,v+=(b+=a*d)>>>16,h+=(v+=r*p)>>>16,v&=65535,h+=(v+=i*d)>>>16,v&=65535,h+=(v+=a*l)>>>16,h+=t*p+r*d+i*l+a*s,c((b&=65535)<<16|(y&=65535),(h&=65535)<<16|(v&=65535),this.unsigned)},A.mul=A.multiply,A.divide=function(e){if(o(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,r,i;if(n)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return w;i=b}else{if(this.eq(k))return e.eq(y)||e.eq(S)?k:e.eq(k)?y:(t=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:S:(r=this.sub(e.mul(t)),i=t.add(r.div(e)));if(e.eq(k))return this.unsigned?b:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),s=a<=48?1:l(2,a-48),d=u(t),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=u(t-=s,this.unsigned)).mul(e);d.isZero()&&(d=y),i=i.add(d),r=r.sub(p)}return i},A.div=A.divide,A.modulo=function(e){return o(e)||(e=f(e)),n?c((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return c(~this.low,~this.high,this.unsigned)},A.and=function(e){return o(e)||(e=f(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return o(e)||(e=f(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return o(e)||(e=f(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},A.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<>>32-e,this.unsigned):c(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},A.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,n){"use strict";(function(e){function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:s.default.Writer.create();return""!==e.typeUrl&&t.uint32(10).string(e.typeUrl),0!==e.value.length&&t.uint32(18).bytes(e.value),t},decode:function(e,t){var n=e instanceof s.default.Reader?e:new s.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},u);for(o.value=new Uint8Array;n.pos>>3){case 1:o.typeUrl=n.string();break;case 2:o.value=n.bytes();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},u);return t.value=new Uint8Array,void 0!==e.typeUrl&&null!==e.typeUrl?t.typeUrl=String(e.typeUrl):t.typeUrl="",void 0!==e.value&&null!==e.value&&(t.value=function(e){for(var t=l(e),n=new Uint8Array(t.length),r=0;r0&&O.AccAddress.validate(a[0].terraAddress)&&t){var c=a[0],l=c.terraAddress,d=c.connectType,f=c.design;return{network:u,terraAddress:l,walletAddress:l,design:f,post:function(e){return n(e,l)},sign:function(e){return r(e,l)},signBytes:function(e){return o(e,l)},availablePost:i.has("post"),availableSign:i.has("sign"),availableSignBytes:i.has("sign-bytes"),connectType:d,connection:t}}return}catch(e){return}}function A(e){var t=e.status,n=e.installations;if(t===v.WALLET_NOT_CONNECTED)return n}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=new Map;function E(e){var t=e.lcdClientConfig,n=e.network,r=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=e.toString("hex");return t?U(n):n}function d(e){return e.toString("utf8")}function f(e){return e.readUIntBE(0,e.length)}function p(e){return u.default(e)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l(p(e),t)}function v(e){return d(p(e))}function m(e){return f(p(e))}function g(e){return Array.from(e).map(O).join("")}function b(t){return e.from(B(t),"hex")}function y(e){return c(b(e))}function w(e){return g(y(e))}function S(t){return e.from(t,"utf8")}function _(e){return c(S(e))}function O(e){return j((e>>>0).toString(2))}function k(e){return p(A(e))}function A(e){return new Uint8Array(I(e).map((function(e){return parseInt(e,2)})))}function P(e,t){return h(A(e),t)}function T(e){return!("string"!=typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8==0}function M(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function E(t){return e.isBuffer(t)}function x(e){return s.default.strict(e)&&!E(e)}function C(e){return!x(e)&&!E(e)&&void 0!==e.byteLength}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=e%t;return n?(e-n)/t*t+t:e}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=j(e).match(new RegExp(".{".concat(t,"}"),"gi"));return Array.from(n||[])}function N(e){return I(e).map(H).join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return D(e,R(e.length,t),n)}function D(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return L(e,t,!0,n)}function B(e){return e.replace(/^0x/,"")}function U(e){return e.startsWith("0x")?e:"0x".concat(e)}function H(e){return e.split("").reverse().join("")}function L(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"0",o=t-e.length,i=e;if(o>0){var a=r.repeat(o);i=n?a+e:e+a}return i}t.bufferToArray=c,t.bufferToHex=l,t.bufferToUtf8=d,t.bufferToNumber=f,t.bufferToBinary=function(e){return g(c(e))},t.arrayToBuffer=p,t.arrayToHex=h,t.arrayToUtf8=v,t.arrayToNumber=m,t.arrayToBinary=g,t.hexToBuffer=b,t.hexToArray=y,t.hexToUtf8=function(e){return d(b(e))},t.hexToNumber=function(e){return m(y(e))},t.hexToBinary=w,t.utf8ToBuffer=S,t.utf8ToArray=_,t.utf8ToHex=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l(S(e),t)},t.utf8ToNumber=function(e){var t=parseInt(e,10);return function(e,t){if(!e)throw new Error(t)}(!function(e){return void 0===e}(t),"Number can only safely store up to 53 bits"),t},t.utf8ToBinary=function(e){return g(_(e))},t.numberToBuffer=function(e){return k(O(e))},t.numberToArray=function(e){return A(O(e))},t.numberToHex=function(e,t){return P(O(e),t)},t.numberToUtf8=function(e){return"".concat(e)},t.numberToBinary=O,t.binaryToBuffer=k,t.binaryToArray=A,t.binaryToHex=P,t.binaryToUtf8=function(e){return v(A(e))},t.binaryToNumber=function(e){return m(A(e))},t.isBinaryString=T,t.isHexString=M,t.isBuffer=E,t.isTypedArray=x,t.isArrayBuffer=C,t.getType=function(e){return E(e)?"buffer":x(e)?"typed-array":C(e)?"array-buffer":Array.isArray(e)?"array":i(e)},t.getEncoding=function(e){return T(e)?"binary":M(e)?"hex":"utf8"},t.concatBuffers=function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&(e=e.slice(n)),e},t.trimRight=function(e,t){return e.slice(0,t)},t.calcByteLength=R,t.splitBytes=I,t.swapBytes=N,t.swapHex=function(e){return P(N(w(e)))},t.sanitizeBytes=j,t.padLeft=D,t.padRight=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return L(e,t,!1,n)},t.removeHexPrefix=B,t.addHexPrefix=U,t.sanitizeHex=function(e){return(e=j(e=B(e),2))&&(e=U(e)),e},t.removeHexLeadingZeros=function(e){var t=e.startsWith("0x");return e=(e=B(e)).startsWith("0")?e.substring(1):e,t?U(e):e}}).call(this,n(8).Buffer)},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"r",(function(){return u})),n.d(t,"m",(function(){return c})),n.d(t,"k",(function(){return d})),n.d(t,"i",(function(){return p})),n.d(t,"B",(function(){return g})),n.d(t,"j",(function(){return b})),n.d(t,"A",(function(){return y})),n.d(t,"v",(function(){return w})),n.d(t,"C",(function(){return _})),n.d(t,"b",(function(){return P})),n.d(t,"c",(function(){return T})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return E})),n.d(t,"f",(function(){return x})),n.d(t,"w",(function(){return V})),n.d(t,"x",(function(){return G})),n.d(t,"z",(function(){return I})),n.d(t,"D",(function(){return N})),n.d(t,"h",(function(){return W})),n.d(t,"u",(function(){return X})),n.d(t,"y",(function(){return Y})),n.d(t,"l",(function(){return q})),n.d(t,"a",(function(){return Z})),n.d(t,"o",(function(){return D})),n.d(t,"q",(function(){return B})),n.d(t,"p",(function(){return U})),n.d(t,"n",(function(){return H})),n.d(t,"s",(function(){return L})),n.d(t,"t",(function(){return J}));var r=n(410),o=n(39),i=n(411);function a(e){return Object(i.a)(e)}function s(){var e=a();return e&&e.os?e.os:void 0}function u(){return!!s()&&(function(){var e=s();return!!e&&e.toLowerCase().includes("android")}()||function(){var e=s();return!!e&&(e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}())}function c(){var e;return!(e=a(),e&&e.name&&"node"===e.name.toLowerCase()||!l())}o.getFromWindow,o.getFromWindowOrThrow,o.getDocumentOrThrow,o.getDocument,o.getNavigatorOrThrow;var l=o.getNavigator,d=(o.getLocationOrThrow,o.getLocation),f=(o.getCryptoOrThrow,o.getCrypto,o.getLocalStorageOrThrow,o.getLocalStorage);function p(){return r.getWindowMetadata()}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var v=function(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type ".concat(h(e)));try{return JSON.parse(e)}catch(t){return e}},m=function(e){return"string"==typeof e?e:JSON.stringify(e)};function g(e,t){var n=m(t),r=f();r&&r.setItem(e,n)}function b(e){var t=null,n=f();return n&&(t=n.getItem(e)),t?v(t):t}function y(e){var t=f();t&&t.removeItem(e)}var w="WALLETCONNECT_DEEPLINK_CHOICE";var S=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],_=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],O=n(136),k=n.n(O),A=n(5);function P(e){return A.arrayToBuffer(new Uint8Array(e))}function T(e,t){return A.arrayToHex(new Uint8Array(e),!t)}function M(e){return A.bufferToArray(e).buffer}function E(e){return A.hexToArray(e).buffer}function x(e,t){var n=A.removeHexPrefix(A.sanitizeHex(new k.a(e).toString(16)));return t?n:A.addHexPrefix(n)}var C=n(412);function R(e){return A.sanitizeHex(e)}var I=n(413).payloadId;function N(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()}function j(e,t){return A.isHexString(e,t)}function D(e){return void 0!==e.method}function B(e){return void 0!==e.result}function U(e){return void 0!==e.error}function H(e){return void 0!==e.event}function L(e){return S.includes(e)||e.startsWith("wc_")}function J(e){return!!e.method.startsWith("wc_")||!_.includes(e.method)}function z(e){e=Object(A.removeHexPrefix)(e.toLowerCase());for(var t,n=Object(A.removeHexPrefix)(Object(C.keccak_256)((t=e,A.utf8ToBuffer(t)))),r="",o=0;o7?r+=e[o].toUpperCase():r+=e[o];return Object(A.addHexPrefix)(r)}function V(e){var t,n,r;return(r=e)&&r.length&&!j(e[0])&&(e[0]=(t=e[0],A.utf8ToHex(t,!n))),e}function G(e){if(void 0!==e.type&&"0"!==e.type)return e;if(void 0===e.from||(!(t=e.from)||"0x"!==t.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(t)||!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t)&&t!==z(t)))throw new Error("Transaction object must include a valid 'from' value.");var t;function n(e){var t,n=e;return("number"==typeof e||"string"==typeof e&&!function(e){return""===e||"string"==typeof e&&""===e.trim()}(e))&&(j(e)?"string"==typeof e&&(n=R(e)):n=x(e)),"string"==typeof n&&(t=n,n=A.removeHexLeadingZeros(A.addHexPrefix(t))),n}var r={from:R(e.from),to:void 0===e.to?"":R(e.to),gasPrice:void 0===e.gasPrice?"":n(e.gasPrice),gas:void 0===e.gas?void 0===e.gasLimit?"":n(e.gasLimit):n(e.gas),value:void 0===e.value?"":n(e.value),nonce:void 0===e.nonce?"":n(e.nonce),data:void 0===e.data?"":R(e.data)||"0x"},o=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach((function(e){!r[e].trim().length&&o.includes(e)&&delete r[e]})),r}function W(e){var t=e.message||"Failed or Rejected Request",n=-32e3;if(e&&!e.code)switch(t){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}return{code:n,message:t}}var F=n(243);function q(e){var t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""}function Z(e,t){var n=K(e);return e=function(e){return F.stringify(e)}(n=Object.assign(Object.assign({},n),t))}function K(e){return F.parse(e)}function X(e){return void 0!==e.bridge}function Y(e){var t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t);var o=function(e){var t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,n));var i=function(e){var t=K(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==n?e.substr(n):"");return Object.assign(Object.assign({protocol:r},o),i)}},function(e,t,n){"use strict";e.exports=n(626)},function(e,t,n){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var r=n(679),o=n(680),i=n(313);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return L(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var d=!0,f=0;fo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function P(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),d=0;do)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function j(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||j(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||j(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);R(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);R(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(9))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"i",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return u})),n.d(t,"k",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"j",(function(){return d})),n.d(t,"d",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return h})); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var r=function(e,t){return(r=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)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o1||s(e,t)}))})}function s(e,t){try{(n=o[e](t)).value instanceof f?Promise.resolve(n.value.v).then(u,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function h(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=c(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}Object.create},function(e,t){e.exports=window.React},function(e,t,n){var r=n(17);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,"a",(function(){return r}))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return"object"===n(e)?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var r;n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return o})),n.d(t,"f",(function(){return g})),n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return y})),n.d(t,"e",(function(){return w})),function(e){e.INITIALIZING="initializing",e.NO_AVAILABLE="no_available",e.READY="ready"}(r||(r={}));var o;n(24);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n0?o(r(e),9007199254740991):0}},function(e,t,n){e.exports=!n(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){"use strict";var r=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.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(38),t),o(n(733),t),o(n(805),t),o(n(849),t),o(n(859),t)},function(e,t,n){var r=n(12),o=n(246),i=n(63),a=Object.defineProperty;t.f=n(23)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(64);e.exports=function(e){return Object(r(e))}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d1)for(var n=1;n */ +var r=n(8),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},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.DecProto=t.IntProto=t.DecCoin=t.Coin=t.protobufPackage=void 0;var o=r(n(2)),i=r(n(7));t.protobufPackage="cosmos.base.v1beta1";var a={denom:"",amount:""};t.Coin={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.denom&&t.uint32(10).string(e.denom),""!==e.amount&&t.uint32(18).string(e.amount),t},decode:function(e,t){for(var n=e instanceof i.default.Reader?e:new i.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},a);n.pos>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(7&s)}}return o},fromJSON:function(e){var t=Object.assign({},a);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=String(e.amount):t.amount="",t},toJSON:function(e){var t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.amount&&(t.amount=e.amount),t},fromPartial:function(e){var t=Object.assign({},a);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=e.amount:t.amount="",t}};var s={denom:"",amount:""};t.DecCoin={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.denom&&t.uint32(10).string(e.denom),""!==e.amount&&t.uint32(18).string(e.amount),t},decode:function(e,t){for(var n=e instanceof i.default.Reader?e:new i.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},s);n.pos>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(7&a)}}return o},fromJSON:function(e){var t=Object.assign({},s);return void 0!==e.denom&&null!==e.denom?t.denom=String(e.denom):t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=String(e.amount):t.amount="",t},toJSON:function(e){var t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.amount&&(t.amount=e.amount),t},fromPartial:function(e){var t=Object.assign({},s);return void 0!==e.denom&&null!==e.denom?t.denom=e.denom:t.denom="",void 0!==e.amount&&null!==e.amount?t.amount=e.amount:t.amount="",t}};var u={int:""};t.IntProto={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.int&&t.uint32(10).string(e.int),t},decode:function(e,t){for(var n=e instanceof i.default.Reader?e:new i.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},u);n.pos>>3){case 1:o.int=n.string();break;default:n.skipType(7&a)}}return o},fromJSON:function(e){var t=Object.assign({},u);return void 0!==e.int&&null!==e.int?t.int=String(e.int):t.int="",t},toJSON:function(e){var t={};return void 0!==e.int&&(t.int=e.int),t},fromPartial:function(e){var t=Object.assign({},u);return void 0!==e.int&&null!==e.int?t.int=e.int:t.int="",t}};var c={dec:""};t.DecProto={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return""!==e.dec&&t.uint32(10).string(e.dec),t},decode:function(e,t){for(var n=e instanceof i.default.Reader?e:new i.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},c);n.pos>>3){case 1:o.dec=n.string();break;default:n.skipType(7&a)}}return o},fromJSON:function(e){var t=Object.assign({},c);return void 0!==e.dec&&null!==e.dec?t.dec=String(e.dec):t.dec="",t},toJSON:function(e){var t={};return void 0!==e.dec&&(t.dec=e.dec),t},fromPartial:function(e){var t=Object.assign({},c);return void 0!==e.dec&&null!==e.dec?t.dec=e.dec:t.dec="",t}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return c}));var i="INTERNAL_ERROR",a="SERVER_ERROR",s=[-32700,-32600,-32601,-32602,-32603],u=[-32e3,-32099],c=(o(r={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),o(r,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),o(r,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),o(r,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),o(r,i,{code:-32603,message:"Internal error"}),o(r,a,{code:-32e3,message:"Server error"}),r)},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=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)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"+o+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*o((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=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)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Coin=void 0;var i=n(1),a=n(36),s=n(30),u=function(e){function t(t,n){var r=e.call(this)||this;return r.denom=t,r.amount=a.Numeric.parse(n),r}return o(t,e),t.prototype.isIntCoin=function(){return this.amount instanceof a.Int},t.prototype.isDecCoin=function(){return this.amount instanceof a.Dec},t.prototype.toIntCoin=function(){return new t(this.denom,new a.Int(this.amount))},t.prototype.toIntCeilCoin=function(){return new t(this.denom,new a.Int(this.amount.ceil()))},t.prototype.toDecCoin=function(){return new t(this.denom,new a.Dec(this.amount))},t.prototype.toString=function(){var e=this.amount.toFixed();return this.isDecCoin()&&-1===e.indexOf(".")?"".concat(e,".0").concat(this.denom):"".concat(e).concat(this.denom)},t.fromString=function(e){var n=e.match(/^(-?[0-9]+(\.[0-9]+)?)([0-9a-zA-Z/]+)$/);if(null===n)throw new Error("failed to parse to Coin: ".concat(e));var r=n[1];return new t(n[3],r)},t.prototype.add=function(e){var n;if(e instanceof t){if(e.denom!==this.denom)throw new t.ArithmeticError("cannot add two Coins of different denoms: ".concat(this.denom," and ").concat(e.denom));n=e.amount}else n=e;return n=a.Numeric.parse(n),new t(this.denom,this.amount.add(n))},t.prototype.sub=function(e){var n;if(e instanceof t){if(e.denom!==this.denom)throw new t.ArithmeticError("cannot subtract two Coins of different denoms: ".concat(this.denom," and ").concat(e.denom));n=e.amount}else n=e;return n=a.Numeric.parse(n),new t(this.denom,this.amount.sub(n))},t.prototype.mul=function(e){var n=a.Numeric.parse(e);return new t(this.denom,this.amount.mul(n))},t.prototype.div=function(e){var n=a.Numeric.parse(e);return new t(this.denom,this.amount.div(n))},t.prototype.mod=function(e){var n=a.Numeric.parse(e);return new t(this.denom,this.amount.mod(n))},t.fromAmino=function(e){return new t(e.denom,e.amount)},t.prototype.toAmino=function(){return{denom:this.denom,amount:this.amount.toString()}},t.fromData=function(e){return new t(e.denom,e.amount)},t.prototype.toData=function(){return{denom:this.denom,amount:this.amount.toString()}},t.fromProto=function(e){return new t(e.denom,a.Numeric.parse(e.amount))},t.prototype.toProto=function(){return s.Coin.fromPartial({denom:this.denom,amount:this.amount.toString()})},t}(i.JSONSerializable);t.Coin=u,function(e){var t=function(e){this.message=e};e.ArithmeticError=t}(u=t.Coin||(t.Coin={})),t.Coin=u},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=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)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),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]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=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 a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Height=void 0;var u=n(106),c=s(n(2)),l=function(e){function t(t,n){var r=e.call(this)||this;return r.revision_number=t,r.revision_height=n,r}return o(t,e),t.fromAmino=function(e){var n=e.revision_number,r=e.revision_height;return new t(parseInt(n),parseInt(r))},t.prototype.toAmino=function(){var e=this.revision_number,t=this.revision_height;return{revision_number:e.toFixed(),revision_height:t.toFixed()}},t.fromData=function(e){var n=e.revision_number,r=e.revision_height;return new t(Number.parseInt(n),Number.parseInt(r))},t.prototype.toData=function(){var e=this.revision_number,t=this.revision_height;return{revision_number:e.toFixed(),revision_height:t.toFixed()}},t.fromProto=function(e){return new t(e.revisionNumber.toNumber(),e.revisionHeight.toNumber())},t.prototype.toProto=function(){var e=this.revision_number,t=this.revision_height;return u.Height.fromPartial({revisionNumber:c.fromNumber(e),revisionHeight:c.fromNumber(t)})},t}(n(1).JSONSerializable);t.Height=l},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=n(364),i=Object.prototype.toString;function a(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function u(e){return null!==e&&"object"===r(e)}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function d(e,t){if(null!=e)if("object"!==r(e)&&(e=[e]),a(e))for(var n=0,o=e.length;n(o>>1)-1?(o>>1)-u:u,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,u=e.andln(3)+o&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0==(1&c)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new o(e,"hex","le")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(16);function o(e){return function(t){if(function(e){return Object(r.a)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(10),o=n(179),i=n(180),a=n(28),s=n(178),u=n(181),c=n(184),l=n(182),d=n(101),f=n(16),p=n(176),h=n(112);function v(e){if(e instanceof a.a)return e;if(null!=e){if(Object(s.a)(e))return b=e,new a.a((function(e){var t=b[h.a]();if(Object(f.a)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Object(o.a)(e))return g=e,new a.a((function(e){for(var t=0;t0?r:n)(e)}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c}));var r=n(244),o=n.n(r),i=n(187),a=n.n(i),s=function(){return!!new a.a(navigator.userAgent).os()},u=function(e){var t=navigator.userAgent;if(e)return!0;var n=o.a.getParser(t),r=new a.a(navigator.userAgent);return!(!n.satisfies({chrome:">60",edge:">80"})||r.os())},c=function(e){var t=o.a.getParser(e);return new a.a(navigator.userAgent).mobile()?null:t.satisfies({chrome:">60",chromium:">60"})?"chrome":t.satisfies({edge:">80"})?"edge":null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p})),n.d(t,"c",(function(){return v})),n.d(t,"d",(function(){return g})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return S}));var r=n(34),o=n(20);function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e){return e===o.a?{length:o.b,name:o.a}:{hash:{name:o.f},name:o.e}}function u(e){return e===o.a?[o.d,o.c]:[o.k,o.l]}function c(e){return l.apply(this,arguments)}function l(){return(l=a(regeneratorRuntime.mark((function e(t){var n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:o.a,e.abrupt("return",r.getSubtleCrypto().importKey("raw",t,s(n),!0,u(n)));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(e,t,n){return f.apply(this,arguments)}function f(){return(f=a(regeneratorRuntime.mark((function e(t,n,i){var a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.getSubtleCrypto(),e.next=3,c(n,o.a);case 3:return s=e.sent,e.next=6,a.encrypt({iv:t,name:o.a},s,i);case 6:return u=e.sent,e.abrupt("return",new Uint8Array(u));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t,n){return h.apply(this,arguments)}function h(){return(h=a(regeneratorRuntime.mark((function e(t,n,i){var a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.getSubtleCrypto(),e.next=3,c(n,o.a);case 3:return s=e.sent,e.next=6,a.decrypt({iv:t,name:o.a},s,i);case 6:return u=e.sent,e.abrupt("return",new Uint8Array(u));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,t){return m.apply(this,arguments)}function m(){return(m=a(regeneratorRuntime.mark((function e(t,n){var i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.getSubtleCrypto(),e.next=3,c(t,o.e);case 3:return a=e.sent,e.next=6,i.sign({length:o.g,name:o.e},a,n);case 6:return s=e.sent,e.abrupt("return",new Uint8Array(s));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e,t){return b.apply(this,arguments)}function b(){return(b=a(regeneratorRuntime.mark((function e(t,n){var i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.getSubtleCrypto(),e.next=3,c(t,o.e);case 3:return a=e.sent,e.next=6,i.sign({length:o.h,name:o.e},a,n);case 6:return s=e.sent,e.abrupt("return",new Uint8Array(s));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return w.apply(this,arguments)}function w(){return(w=a(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.getSubtleCrypto(),e.next=3,n.digest({name:o.i},t);case 3:return i=e.sent,e.abrupt("return",new Uint8Array(i));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e){return _.apply(this,arguments)}function _(){return(_=a(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.getSubtleCrypto(),e.next=3,n.digest({name:o.j},t);case 3:return i=e.sent,e.abrupt("return",new Uint8Array(i));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"h",(function(){return se})),n.d(t,"g",(function(){return ue})),n.d(t,"b",(function(){return ee})),n.d(t,"f",(function(){return W})),n.d(t,"a",(function(){return F})),n.d(t,"d",(function(){return q})),n.d(t,"c",(function(){return Z})),n.d(t,"e",(function(){return K}));var r={};n.r(r),n.d(r,"generateKey",(function(){return O})),n.d(r,"verifyHmac",(function(){return A})),n.d(r,"encrypt",(function(){return T})),n.d(r,"decrypt",(function(){return E}));var o=n(6),i=n(414);function a(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"walletconnect";u(this,e),this.storageId=t}var t,n,r;return t=e,(n=[{key:"getSession",value:function(){var e=null,t=Object(o.j)(this.storageId);return t&&Object(o.u)(t)&&(e=t),e}},{key:"setSession",value:function(e){return Object(o.B)(this.storageId,e),e}},{key:"removeSession",value:function(){Object(o.A)(this.storageId)}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),d="abcdefghijklmnopqrstuvwxyz0123456789".split("").map((function(e){return"https://".concat(e,".bridge.walletconnect.org")}));function f(){return d[Math.floor(Math.random()*d.length)]}function p(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,s,"next",e)}function s(e){p(i,r,o,a,s,"throw",e)}a(void 0)}))}}function v(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1?e.split("/")[2]:e.split("/")[0];return t=(t=t.split(":")[0]).split("?")[0]}(e).split(".").slice(-2).join(".")}(e)}(n=t.connectorOpts.bridge)?f():n),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);var r=t.connectorOpts.session||this._getStorageSession();r&&(this.session=r),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new i.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}var t,n,r,a,u,c,d,p,m,b,y,w,S,_,O,k,A,P,T,M,E;return t=e,(n=[{key:"bridge",get:function(){return this._bridge},set:function(e){e&&(this._bridge=e)}},{key:"key",get:function(){return this._key?Object(o.c)(this._key,!0):""},set:function(e){if(e){var t=Object(o.e)(e);this._key=t}}},{key:"clientId",get:function(){var e=this._clientId;return e||(e=this._clientId=Object(o.D)()),this._clientId},set:function(e){e&&(this._clientId=e)}},{key:"peerId",get:function(){return this._peerId},set:function(e){e&&(this._peerId=e)}},{key:"clientMeta",get:function(){var e=this._clientMeta;return e||(e=this._clientMeta=Object(o.i)()),e},set:function(e){}},{key:"peerMeta",get:function(){return this._peerMeta},set:function(e){this._peerMeta=e}},{key:"handshakeTopic",get:function(){return this._handshakeTopic},set:function(e){e&&(this._handshakeTopic=e)}},{key:"handshakeId",get:function(){return this._handshakeId},set:function(e){e&&(this._handshakeId=e)}},{key:"uri",get:function(){return this._formatUri()},set:function(e){if(e){var t=this._parseUri(e),n=t.handshakeTopic,r=t.bridge,o=t.key;this.handshakeTopic=n,this.bridge=r,this.key=o}}},{key:"chainId",get:function(){return this._chainId},set:function(e){this._chainId=e}},{key:"networkId",get:function(){return this._networkId},set:function(e){this._networkId=e}},{key:"accounts",get:function(){return this._accounts},set:function(e){this._accounts=e}},{key:"rpcUrl",get:function(){return this._rpcUrl},set:function(e){this._rpcUrl=e}},{key:"connected",get:function(){return this._connected},set:function(e){}},{key:"pending",get:function(){return!!this._handshakeTopic},set:function(e){}},{key:"session",get:function(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}},set:function(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}},{key:"on",value:function(e,t){var n={event:e,callback:t};this._eventManager.subscribe(n)}},{key:"off",value:function(e){this._eventManager.unsubscribe(e)}},{key:"createInstantRequest",value:(E=h(regeneratorRuntime.mark((function e(t){var n,r,i,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._generateKey();case 2:return this._key=e.sent,n=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]}),this.handshakeId=n.id,this.handshakeTopic=Object(o.D)(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(function(){throw new Error("User close QRCode Modal")})),r=function(){a.killSession()},e.prev=9,e.next=12,this._sendCallRequest(n);case 12:return(i=e.sent)&&r(),e.abrupt("return",i);case 17:throw e.prev=17,e.t0=e.catch(9),r(),e.t0;case 21:case"end":return e.stop()}}),e,this,[[9,17]])}))),function(e){return E.apply(this,arguments)})},{key:"connect",value:(M=h(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._qrcodeModal){e.next=2;break}throw new Error("QRCode Modal not provided");case 2:if(!this.connected){e.next=4;break}return e.abrupt("return",{chainId:this.chainId,accounts:this.accounts});case 4:return e.next=6,this.createSession(t);case 6:return e.abrupt("return",new Promise(function(){var e=h(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.on("modal_closed",(function(){return r(new Error("User close QRCode Modal"))})),n.on("connect",(function(e,n){if(e)return r(e);t(n.params[0])}));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"createSession",value:(T=h(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._connected){e.next=2;break}throw new Error("Session currently connected");case 2:if(!this.pending){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._generateKey();case 6:this._key=e.sent,n=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]}),this.handshakeId=n.id,this.handshakeTopic=Object(o.D)(),this._sendSessionRequest(n,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]});case 12:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"approveSession",value:function(e){if(this._connected)throw new Error("Session currently connected");this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},n={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(n),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}},{key:"rejectSession",value:function(e){if(this._connected)throw new Error("Session currently connected");var t=e&&e.message?e.message:"Session Rejected",n=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(n),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}},{key:"updateSession",value:function(e){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},n=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(n,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}},{key:"killSession",value:(P=h(regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t?t.message:"Session Disconnected",r={approved:!1,chainId:null,networkId:null,accounts:null},o=this._formatRequest({method:"wc_sessionUpdate",params:[r]}),e.next=5,this._sendRequest(o);case 5:this._handleSessionDisconnect(n);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"sendTransaction",value:(A=h(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return n=Object(o.x)(t),r=this._formatRequest({method:"eth_sendTransaction",params:[n]}),e.next=6,this._sendCallRequest(r);case 6:return i=e.sent,e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"signTransaction",value:(k=h(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return n=Object(o.x)(t),r=this._formatRequest({method:"eth_signTransaction",params:[n]}),e.next=6,this._sendCallRequest(r);case 6:return i=e.sent,e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"signMessage",value:(O=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return n=this._formatRequest({method:"eth_sign",params:t}),e.next=5,this._sendCallRequest(n);case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"signPersonalMessage",value:(_=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return t=Object(o.w)(t),n=this._formatRequest({method:"personal_sign",params:t}),e.next=6,this._sendCallRequest(n);case 6:return r=e.sent,e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"signTypedData",value:(S=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return n=this._formatRequest({method:"eth_signTypedData",params:t}),e.next=5,this._sendCallRequest(n);case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"updateChain",value:(w=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return n=this._formatRequest({method:"wallet_updateChain",params:[t]}),e.next=5,this._sendCallRequest(n);case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"unsafeSend",value:function(e,t){var n=this;return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),new Promise((function(t,r){n._subscribeToResponse(e.id,(function(e,n){if(e)r(e);else{if(!n)throw new Error("Missing JSON RPC response");t(n)}}))}))}},{key:"sendCustomRequest",value:(y=h(regeneratorRuntime.mark((function e(t,n){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:e.t0=t.method,e.next="eth_accounts"===e.t0?5:"eth_chainId"===e.t0?6:"eth_sendTransaction"===e.t0||"eth_signTransaction"===e.t0?7:"personal_sign"===e.t0?9:11;break;case 5:return e.abrupt("return",this.accounts);case 6:return e.abrupt("return",Object(o.f)(this.chainId));case 7:return t.params&&(t.params[0]=Object(o.x)(t.params[0])),e.abrupt("break",12);case 9:return t.params&&(t.params=Object(o.w)(t.params)),e.abrupt("break",12);case 11:return e.abrupt("break",12);case 12:return r=this._formatRequest(t),e.next=15,this._sendCallRequest(r,n);case 15:return i=e.sent,e.abrupt("return",i);case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"approveRequest",value:function(e){if(!Object(o.q)(e))throw new Error('JSON-RPC success response must include "result" field');var t=this._formatResponse(e);this._sendResponse(t)}},{key:"rejectRequest",value:function(e){if(!Object(o.p)(e))throw new Error('JSON-RPC error response must include "error" field');var t=this._formatResponse(e);this._sendResponse(t)}},{key:"transportClose",value:function(){this._transport.close()}},{key:"_sendRequest",value:(b=h(regeneratorRuntime.mark((function e(t,n){var r,i,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._formatRequest(t),e.next=3,this._encrypt(r);case 3:i=e.sent,a=void 0!==(null==n?void 0:n.topic)?n.topic:this.peerId,s=JSON.stringify(i),u=void 0!==(null==n?void 0:n.forcePushNotification)?!n.forcePushNotification:Object(o.t)(r),this._transport.send(s,a,u);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"_sendResponse",value:(m=h(regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._encrypt(t);case 2:n=e.sent,r=this.peerId,o=JSON.stringify(n),this._transport.send(o,r,!0);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"_sendSessionRequest",value:(p=h(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._sendRequest(t,r),this._subscribeToSessionResponse(t.id,n);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"_sendCallRequest",value:function(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),this._subscribeToCallResponse(e.id)}},{key:"_formatRequest",value:function(e){if(void 0===e.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===e.id?Object(o.z)():e.id,jsonrpc:"2.0",method:e.method,params:void 0===e.params?[]:e.params}}},{key:"_formatResponse",value:function(e){if(void 0===e.id)throw new Error('JSON RPC request must have valid "id" value');var t={id:e.id,jsonrpc:"2.0"};if(Object(o.p)(e)){var n=Object(o.h)(e.error);return Object.assign(Object.assign(Object.assign({},t),e),{error:n})}if(Object(o.q)(e))return Object.assign(Object.assign({},t),e);throw new Error("JSON RPC response format is invalid")}},{key:"_handleSessionDisconnect",value:function(e){var t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(o.A)(o.v)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession(),this.transportClose()}},{key:"_handleSessionResponse",value:function(e,t){t&&t.approved?(this._connected?(t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),t.peerId&&!this.peerId&&(this.peerId=t.peerId),t.peerMeta&&!this.peerMeta&&(this.peerMeta=t.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e)}},{key:"_handleIncomingMessages",value:(d=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if([this.clientId,this.handshakeTopic].includes(t.topic)){e.next=3;break}return e.abrupt("return");case 3:e.prev=3,n=JSON.parse(t.payload),e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(3),e.abrupt("return");case 10:return e.next=12,this._decrypt(n);case 12:(r=e.sent)&&this._eventManager.trigger(r);case 14:case"end":return e.stop()}}),e,this,[[3,7]])}))),function(e){return d.apply(this,arguments)})},{key:"_subscribeToSessionRequest",value:function(){this._transport.subscribe(this.handshakeTopic)}},{key:"_subscribeToResponse",value:function(e,t){this.on("response:".concat(e),t)}},{key:"_subscribeToSessionResponse",value:function(e,t){var n=this;this._subscribeToResponse(e,(function(e,r){e?n._handleSessionResponse(e.message):r.result?n._handleSessionResponse(t,r.result):r.error&&r.error.message?n._handleSessionResponse(r.error.message):n._handleSessionResponse(t)}))}},{key:"_subscribeToCallResponse",value:function(e){var t=this;return new Promise((function(n,r){t._subscribeToResponse(e,(function(e,t){e?r(e):t.result?n(t.result):t.error&&t.error.message?r(new Error(t.error.message)):r(new Error("JSON RPC response format is invalid"))}))}))}},{key:"_subscribeToInternalEvents",value:function(){var e=this;this.on("display_uri",(function(){e._qrcodeModal&&e._qrcodeModal.open(e.uri,(function(){e._eventManager.trigger({event:"modal_closed",params:[]})}),e._qrcodeModalOptions)})),this.on("connect",(function(){e._qrcodeModal&&e._qrcodeModal.close()})),this.on("call_request_sent",(function(t,n){var r=n.params[0].request;if(Object(o.r)()&&e._signingMethods.includes(r.method)){var i=Object(o.j)(o.v);i&&(window.location.href=i.href)}})),this.on("wc_sessionRequest",(function(t,n){t&&e._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),e.handshakeId=n.id,e.peerId=n.params[0].peerId,e.peerMeta=n.params[0].peerMeta;var r=Object.assign(Object.assign({},n),{method:"session_request"});e._eventManager.trigger(r)})),this.on("wc_sessionUpdate",(function(t,n){t&&e._handleSessionResponse(t.message),e._handleSessionResponse("Session disconnected",n.params[0])}))}},{key:"_initTransport",value:function(){var e=this;this._transport.on("message",(function(t){return e._handleIncomingMessages(t)})),this._transport.on("open",(function(){return e._eventManager.trigger({event:"transport_open",params:[]})})),this._transport.on("close",(function(){return e._eventManager.trigger({event:"transport_close",params:[]})})),this._transport.on("error",(function(){return e._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})})),this._transport.open()}},{key:"_formatUri",value:function(){var e=this.protocol,t=this.handshakeTopic,n=this.version,r=encodeURIComponent(this.bridge),o=this.key;return"".concat(e,":").concat(t,"@").concat(n,"?bridge=").concat(r,"&key=").concat(o)}},{key:"_parseUri",value:function(e){var t=Object(o.y)(e);if(t.protocol===this.protocol){if(!t.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");var n=t.handshakeTopic;if(!t.bridge)throw Error("Invalid or missing bridge url parameter value");var r=decodeURIComponent(t.bridge);if(!t.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:n,bridge:r,key:t.key}}throw new Error("URI format is invalid")}},{key:"_generateKey",value:(c=h(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._cryptoLib){e.next=5;break}return e.next=3,this._cryptoLib.generateKey();case 3:return t=e.sent,e.abrupt("return",t);case 5:return e.abrupt("return",null);case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_encrypt",value:(u=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._key,!this._cryptoLib||!n){e.next=6;break}return e.next=4,this._cryptoLib.encrypt(t,n);case 4:return r=e.sent,e.abrupt("return",r);case 6:return e.abrupt("return",null);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_decrypt",value:(a=h(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._key,!this._cryptoLib||!n){e.next=6;break}return e.next=4,this._cryptoLib.decrypt(t,n);case 4:return r=e.sent,e.abrupt("return",r);case 6:return e.abrupt("return",null);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_getStorageSession",value:function(){var e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}},{key:"_setStorageSession",value:function(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}},{key:"_removeStorageSession",value:function(){this._sessionStorage&&this._sessionStorage.removeSession()}},{key:"_manageStorageSession",value:function(){this._connected?this._setStorageSession():this._removeStorageSession()}},{key:"_registerPushServer",value:function(e){if(!e.url||"string"!=typeof e.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||"string"!=typeof e.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||"string"!=typeof e.token)throw Error("Invalid or missing pushServerOpts.token parameter value");var t={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",function(){var n=h(regeneratorRuntime.mark((function n(r,o){var i,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r){n.next=2;break}throw r;case 2:return e.peerMeta&&(i=o.params[0].peerMeta.name,t.peerName=i),n.prev=3,n.next=6,fetch("".concat(e.url,"/new"),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});case 6:return a=n.sent,n.next=9,a.json();case 9:if(n.sent.success){n.next=12;break}throw Error("Failed to register in Push Server");case 12:n.next=17;break;case 14:throw n.prev=14,n.t0=n.catch(3),Error("Failed to register in Push Server");case 17:case"end":return n.stop()}}),n,null,[[3,14]])})));return function(e,t){return n.apply(this,arguments)}}())}}])&&g(t.prototype,n),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),y=n(114),w=n(5);function S(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){S(i,r,o,a,s,"next",e)}function s(e){S(i,r,o,a,s,"throw",e)}a(void 0)}))}}function O(e){return k.apply(this,arguments)}function k(){return(k=_(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(t||256)/8,r=y.randomBytes(n),i=Object(o.d)(w.arrayToBuffer(r)),e.abrupt("return",i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,t){return P.apply(this,arguments)}function P(){return(P=_(regeneratorRuntime.mark((function e(t,n){var r,o,i,a,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=w.hexToArray(t.data),o=w.hexToArray(t.iv),i=w.hexToArray(t.hmac),a=w.arrayToHex(i,!1),s=w.concatArrays(r,o),e.next=7,y.hmacSha256Sign(n,s);case 7:if(u=e.sent,c=w.arrayToHex(u,!1),w.removeHexPrefix(a)!==w.removeHexPrefix(c)){e.next=11;break}return e.abrupt("return",!0);case 11:return e.abrupt("return",!1);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e,t,n){return M.apply(this,arguments)}function M(){return(M=_(regeneratorRuntime.mark((function e(t,n,r){var i,a,s,u,c,l,d,f,p,h,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=w.bufferToArray(Object(o.b)(n)),e.t0=r,e.t0){e.next=6;break}return e.next=5,O(128);case 5:e.t0=e.sent;case 6:return a=e.t0,s=w.bufferToArray(Object(o.b)(a)),u=w.arrayToHex(s,!1),c=JSON.stringify(t),l=w.utf8ToArray(c),e.next=13,y.aesCbcEncrypt(s,i,l);case 13:return d=e.sent,f=w.arrayToHex(d,!1),p=w.concatArrays(d,s),e.next=18,y.hmacSha256Sign(i,p);case 18:return h=e.sent,v=w.arrayToHex(h,!1),e.abrupt("return",{data:f,hmac:v,iv:u});case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e,t){return x.apply(this,arguments)}function x(){return(x=_(regeneratorRuntime.mark((function e(t,n){var r,i,a,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=w.bufferToArray(Object(o.b)(n))){e.next=3;break}throw new Error("Missing key: required for decryption");case 3:return e.next=5,A(t,r);case 5:if(e.sent){e.next=8;break}return e.abrupt("return",null);case 8:return i=w.hexToArray(t.data),a=w.hexToArray(t.iv),e.next=12,y.aesCbcDecrypt(a,r,i);case 12:s=e.sent,u=w.arrayToUtf8(s),e.prev=14,c=JSON.parse(u),e.next=21;break;case 18:return e.prev=18,e.t0=e.catch(14),e.abrupt("return",null);case 21:return e.abrupt("return",c);case 22:case"end":return e.stop()}}),e,null,[[14,18]])})))).apply(this,arguments)}var C=n(245),R=n(59);function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){for(var n=0;n .wallet-wc-modal--dim {\n position: fixed;\n z-index: -1;\n\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.3);\n\n animation: wallet-wc-modal--dim-enter 0.2s ease-in-out;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content {\n border-radius: 8px;\n\n background-color: #ffffff;\n box-shadow: 0 4px 18px 3px rgba(0, 0, 0, 0.43);\n \n text-align: center;\n\n animation: wallet-wc-modal--content-enter 0.2s ease-in-out;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content h1 {\n color: #3b99fc;\n \n font-size: 20px;\n font-family: sans-serif;\n font-weight: bold;\n \n margin: 0 0 12px 0;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content p {\n color: #212121;\n \n font-size: 14px;\n font-family: sans-serif;\n \n margin: 0 0 32px 0;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content button {\n display: block;\n \n cursor: pointer;\n outline: none;\n border: 0;\n \n width: 295px;\n height: 48px;\n border-radius: 30px;\n \n font-size: 14px;\n font-weight: bold;\n \n color: #ffffff;\n background-color: #2043b5;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content[data-device="desktop"] {\n padding: 40px 80px;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content[data-device="mobile"] {\n padding: 40px 20px;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content[data-device="mobile"] h1 {\n margin-bottom: 32px;\n}\n\n.wallet-wc-modal > .wallet-wc-modal--content[data-device="mobile"] p {\n display: none;\n}\n',a.appendChild(l),null===(o=document.querySelector("head"))||void 0===o||o.appendChild(s),null===(i=document.querySelector("body"))||void 0===i||i.appendChild(a),t.modalContainer=a,t.styleContainer=s},this.close=function(){var e,n;t.modalContainer&&(null===(e=t.modalContainer.parentElement)||void 0===e||e.removeChild(t.modalContainer)),t.styleContainer&&(null===(n=t.styleContainer.parentElement)||void 0===n||n.removeChild(t.styleContainer)),t.callback=null}}));function ne(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function re(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ne(i,r,o,a,s,"next",e)}function s(e){ne(i,r,o,a,s,"throw",e)}a(void 0)}))}}function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=localStorage.getItem("walletconnect");return"string"==typeof t?ue(e,!0):null}function ue(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=null,s=new C.a({status:ee.DISCONNECTED}),u=null!==(t=null===(e=n.connectorOpts)||void 0===e?void 0:e.qrcodeModal)&&void 0!==t?t:new te,c=ie({bridge:"https://walletconnect.terra.dev/",qrcodeModal:u},n.connectorOpts),l=n.pushServerOpts;function d(){if(!a)throw new Error("WalletConnect is not defined!");a.on("session_update",function(){var e=re(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}throw t;case 2:s.next({status:ee.CONNECTED,peerMeta:n.params[0],terraAddress:n.params[0].accounts[0],chainId:n.params[0].chainId}),console.log("WALLETCONNECT SESSION UPDATED:",n.params[0]);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),a.on("connect",(function(e,t){if(e)throw e;s.next({status:ee.CONNECTED,peerMeta:t.params[0],terraAddress:t.params[0].accounts[0],chainId:t.params[0].chainId})})),a.on("disconnect",(function(e,t){if(e)throw e;s.next({status:ee.DISCONNECTED})}))}var f=localStorage.getItem("walletconnect");if("string"==typeof f&&i){var p=JSON.parse(f),h=p.clientId,v=new b({connectorOpts:ie(ie({},c),{},{session:JSON.parse(f)}),pushServerOpts:l,cryptoLib:r,transport:new X.a({protocol:"wc",version:1,url:c.bridge,subscriptions:[h]})});v.clientId=h,a=v,d(),s.next({status:ee.CONNECTED,peerMeta:v.peerMeta,terraAddress:v.accounts[0],chainId:v.chainId})}else{var m=Object(o.D)(),g=new b({connectorOpts:c,pushServerOpts:l,cryptoLib:r,transport:new X.a({protocol:"wc",version:1,url:c.bridge,subscriptions:[m]})});g.clientId=m,a=g,g.connected||(g.createSession().catch(console.error),u instanceof te&&u.setCloseCallback((function(){s.next({status:ee.DISCONNECTED})})),d(),s.next({status:ee.REQUESTED}))}function y(){if(a&&a.connected)try{a.killSession()}catch(e){}s.next({status:ee.DISCONNECTED})}function w(){return s.asObservable()}function S(){return s.getValue()}function _(e){var t,n,r;if(!a||!a.connected)throw new Error("WalletConnect is not connected!");var o=Date.now(),i={msgs:e.msgs.map((function(e){return e.toJSON()})),fee:null===(t=e.fee)||void 0===t?void 0:t.toJSON(),memo:e.memo,gas:e.gas,gasPrices:null===(n=e.gasPrices)||void 0===n?void 0:n.toString(),gasAdjustment:null===(r=e.gasAdjustment)||void 0===r?void 0:r.toString(),feeDenoms:e.feeDenoms,timeoutHeight:e.timeoutHeight};if(Object(R.c)()){var s=btoa(JSON.stringify({id:o,handshakeTopic:a.handshakeTopic,params:i}));window.location.href="terrastation://walletconnect_confirm/?payload=".concat(s)}return a.sendCustomRequest({id:o,method:"post",params:[i]}).catch((function(e){var t=e;try{var n=JSON.parse(e.message),r=n.code,o=n.txhash,i=n.message,a=n.raw_message;switch(r){case 1:t=new W;break;case 2:t=new F(i);break;case 3:t=new q(o,i,a);break;case 4:t=new Z(i);break;case 99:t=new K(i)}}catch(n){t=new K(e.message)}throw t}))}return{session:w,getLatestSession:S,post:_,disconnect:y}}},function(e,t,n){var r=n(17);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(0),o=n(54),i=n(15);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i((function(){n(1)})),"Object",a)}},function(e,t,n){var r=n(55),o=n(118),i=n(26),a=n(22),s=n(206);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,d=6==e,f=5==e||d,p=t||s;return function(t,s,h){for(var v,m,g=i(t),b=o(g),y=r(s,h,3),w=a(b.length),S=0,_=n?p(t,w):u?p(t,0):void 0;w>S;S++)if((f||S in b)&&(m=y(v=b[S],S,g),e))if(n)_[S]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return S;case 2:_.push(v)}else if(l)return!1;return d?-1:c||l?l:_}}},function(e,t,n){"use strict";(function(e){function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.portId&&t.uint32(10).string(e.portId),void 0!==e.channel&&c.Channel.encode(e.channel,t.uint32(18).fork()).ldelim(),""!==e.signer&&t.uint32(26).string(e.signer),t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},d);n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channel=c.Channel.decode(n,n.uint32());break;case 3:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},d);return void 0!==e.portId&&null!==e.portId?t.portId=String(e.portId):t.portId="",void 0!==e.channel&&null!==e.channel?t.channel=c.Channel.fromJSON(e.channel):t.channel=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channel&&(t.channel=e.channel?c.Channel.toJSON(e.channel):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},d);return void 0!==e.portId&&null!==e.portId?t.portId=e.portId:t.portId="",void 0!==e.channel&&null!==e.channel?t.channel=c.Channel.fromPartial(e.channel):t.channel=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var f={};t.MsgChannelOpenInitResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},f);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.portId&&t.uint32(10).string(e.portId),""!==e.previousChannelId&&t.uint32(18).string(e.previousChannelId),void 0!==e.channel&&c.Channel.encode(e.channel,t.uint32(26).fork()).ldelim(),""!==e.counterpartyVersion&&t.uint32(34).string(e.counterpartyVersion),0!==e.proofInit.length&&t.uint32(42).bytes(e.proofInit),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(50).fork()).ldelim(),""!==e.signer&&t.uint32(58).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},p);for(o.proofInit=new Uint8Array;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.previousChannelId=n.string();break;case 3:o.channel=c.Channel.decode(n,n.uint32());break;case 4:o.counterpartyVersion=n.string();break;case 5:o.proofInit=n.bytes();break;case 6:o.proofHeight=l.Height.decode(n,n.uint32());break;case 7:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},p);return t.proofInit=new Uint8Array,void 0!==e.portId&&null!==e.portId?t.portId=String(e.portId):t.portId="",void 0!==e.previousChannelId&&null!==e.previousChannelId?t.previousChannelId=String(e.previousChannelId):t.previousChannelId="",void 0!==e.channel&&null!==e.channel?t.channel=c.Channel.fromJSON(e.channel):t.channel=void 0,void 0!==e.counterpartyVersion&&null!==e.counterpartyVersion?t.counterpartyVersion=String(e.counterpartyVersion):t.counterpartyVersion="",void 0!==e.proofInit&&null!==e.proofInit&&(t.proofInit=N(e.proofInit)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.previousChannelId&&(t.previousChannelId=e.previousChannelId),void 0!==e.channel&&(t.channel=e.channel?c.Channel.toJSON(e.channel):void 0),void 0!==e.counterpartyVersion&&(t.counterpartyVersion=e.counterpartyVersion),void 0!==e.proofInit&&(t.proofInit=D(void 0!==e.proofInit?e.proofInit:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},p);return void 0!==e.portId&&null!==e.portId?t.portId=e.portId:t.portId="",void 0!==e.previousChannelId&&null!==e.previousChannelId?t.previousChannelId=e.previousChannelId:t.previousChannelId="",void 0!==e.channel&&null!==e.channel?t.channel=c.Channel.fromPartial(e.channel):t.channel=void 0,void 0!==e.counterpartyVersion&&null!==e.counterpartyVersion?t.counterpartyVersion=e.counterpartyVersion:t.counterpartyVersion="",void 0!==e.proofInit&&null!==e.proofInit?t.proofInit=e.proofInit:t.proofInit=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var h={};t.MsgChannelOpenTryResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},h);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),""!==e.counterpartyChannelId&&t.uint32(26).string(e.counterpartyChannelId),""!==e.counterpartyVersion&&t.uint32(34).string(e.counterpartyVersion),0!==e.proofTry.length&&t.uint32(42).bytes(e.proofTry),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(50).fork()).ldelim(),""!==e.signer&&t.uint32(58).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},v);for(o.proofTry=new Uint8Array;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;case 3:o.counterpartyChannelId=n.string();break;case 4:o.counterpartyVersion=n.string();break;case 5:o.proofTry=n.bytes();break;case 6:o.proofHeight=l.Height.decode(n,n.uint32());break;case 7:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},v);return t.proofTry=new Uint8Array,void 0!==e.portId&&null!==e.portId?t.portId=String(e.portId):t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=String(e.channelId):t.channelId="",void 0!==e.counterpartyChannelId&&null!==e.counterpartyChannelId?t.counterpartyChannelId=String(e.counterpartyChannelId):t.counterpartyChannelId="",void 0!==e.counterpartyVersion&&null!==e.counterpartyVersion?t.counterpartyVersion=String(e.counterpartyVersion):t.counterpartyVersion="",void 0!==e.proofTry&&null!==e.proofTry&&(t.proofTry=N(e.proofTry)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),void 0!==e.counterpartyChannelId&&(t.counterpartyChannelId=e.counterpartyChannelId),void 0!==e.counterpartyVersion&&(t.counterpartyVersion=e.counterpartyVersion),void 0!==e.proofTry&&(t.proofTry=D(void 0!==e.proofTry?e.proofTry:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},v);return void 0!==e.portId&&null!==e.portId?t.portId=e.portId:t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=e.channelId:t.channelId="",void 0!==e.counterpartyChannelId&&null!==e.counterpartyChannelId?t.counterpartyChannelId=e.counterpartyChannelId:t.counterpartyChannelId="",void 0!==e.counterpartyVersion&&null!==e.counterpartyVersion?t.counterpartyVersion=e.counterpartyVersion:t.counterpartyVersion="",void 0!==e.proofTry&&null!==e.proofTry?t.proofTry=e.proofTry:t.proofTry=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var m={};t.MsgChannelOpenAckResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},m);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),0!==e.proofAck.length&&t.uint32(26).bytes(e.proofAck),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(34).fork()).ldelim(),""!==e.signer&&t.uint32(42).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},g);for(o.proofAck=new Uint8Array;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;case 3:o.proofAck=n.bytes();break;case 4:o.proofHeight=l.Height.decode(n,n.uint32());break;case 5:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},g);return t.proofAck=new Uint8Array,void 0!==e.portId&&null!==e.portId?t.portId=String(e.portId):t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=String(e.channelId):t.channelId="",void 0!==e.proofAck&&null!==e.proofAck&&(t.proofAck=N(e.proofAck)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),void 0!==e.proofAck&&(t.proofAck=D(void 0!==e.proofAck?e.proofAck:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},g);return void 0!==e.portId&&null!==e.portId?t.portId=e.portId:t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=e.channelId:t.channelId="",void 0!==e.proofAck&&null!==e.proofAck?t.proofAck=e.proofAck:t.proofAck=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var b={};t.MsgChannelOpenConfirmResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},b);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),""!==e.signer&&t.uint32(26).string(e.signer),t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},y);n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;case 3:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},y);return void 0!==e.portId&&null!==e.portId?t.portId=String(e.portId):t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=String(e.channelId):t.channelId="",void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},y);return void 0!==e.portId&&null!==e.portId?t.portId=e.portId:t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=e.channelId:t.channelId="",void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var w={};t.MsgChannelCloseInitResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},w);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),0!==e.proofInit.length&&t.uint32(26).bytes(e.proofInit),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(34).fork()).ldelim(),""!==e.signer&&t.uint32(42).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},S);for(o.proofInit=new Uint8Array;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;case 3:o.proofInit=n.bytes();break;case 4:o.proofHeight=l.Height.decode(n,n.uint32());break;case 5:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},S);return t.proofInit=new Uint8Array,void 0!==e.portId&&null!==e.portId?t.portId=String(e.portId):t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=String(e.channelId):t.channelId="",void 0!==e.proofInit&&null!==e.proofInit&&(t.proofInit=N(e.proofInit)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),void 0!==e.proofInit&&(t.proofInit=D(void 0!==e.proofInit?e.proofInit:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},S);return void 0!==e.portId&&null!==e.portId?t.portId=e.portId:t.portId="",void 0!==e.channelId&&null!==e.channelId?t.channelId=e.channelId:t.channelId="",void 0!==e.proofInit&&null!==e.proofInit?t.proofInit=e.proofInit:t.proofInit=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var _={};t.MsgChannelCloseConfirmResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},_);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.packet&&c.Packet.encode(e.packet,t.uint32(10).fork()).ldelim(),0!==e.proofCommitment.length&&t.uint32(18).bytes(e.proofCommitment),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(26).fork()).ldelim(),""!==e.signer&&t.uint32(34).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},O);for(o.proofCommitment=new Uint8Array;n.pos>>3){case 1:o.packet=c.Packet.decode(n,n.uint32());break;case 2:o.proofCommitment=n.bytes();break;case 3:o.proofHeight=l.Height.decode(n,n.uint32());break;case 4:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},O);return t.proofCommitment=new Uint8Array,void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromJSON(e.packet):t.packet=void 0,void 0!==e.proofCommitment&&null!==e.proofCommitment&&(t.proofCommitment=N(e.proofCommitment)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.packet&&(t.packet=e.packet?c.Packet.toJSON(e.packet):void 0),void 0!==e.proofCommitment&&(t.proofCommitment=D(void 0!==e.proofCommitment?e.proofCommitment:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},O);return void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromPartial(e.packet):t.packet=void 0,void 0!==e.proofCommitment&&null!==e.proofCommitment?t.proofCommitment=e.proofCommitment:t.proofCommitment=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var k={};t.MsgRecvPacketResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},k);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.packet&&c.Packet.encode(e.packet,t.uint32(10).fork()).ldelim(),0!==e.proofUnreceived.length&&t.uint32(18).bytes(e.proofUnreceived),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(26).fork()).ldelim(),e.nextSequenceRecv.isZero()||t.uint32(32).uint64(e.nextSequenceRecv),""!==e.signer&&t.uint32(42).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},A);for(o.proofUnreceived=new Uint8Array;n.pos>>3){case 1:o.packet=c.Packet.decode(n,n.uint32());break;case 2:o.proofUnreceived=n.bytes();break;case 3:o.proofHeight=l.Height.decode(n,n.uint32());break;case 4:o.nextSequenceRecv=n.uint64();break;case 5:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},A);return t.proofUnreceived=new Uint8Array,void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromJSON(e.packet):t.packet=void 0,void 0!==e.proofUnreceived&&null!==e.proofUnreceived&&(t.proofUnreceived=N(e.proofUnreceived)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.nextSequenceRecv&&null!==e.nextSequenceRecv?t.nextSequenceRecv=s.default.fromString(e.nextSequenceRecv):t.nextSequenceRecv=s.default.UZERO,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.packet&&(t.packet=e.packet?c.Packet.toJSON(e.packet):void 0),void 0!==e.proofUnreceived&&(t.proofUnreceived=D(void 0!==e.proofUnreceived?e.proofUnreceived:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.nextSequenceRecv&&(t.nextSequenceRecv=(e.nextSequenceRecv||s.default.UZERO).toString()),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},A);return void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromPartial(e.packet):t.packet=void 0,void 0!==e.proofUnreceived&&null!==e.proofUnreceived?t.proofUnreceived=e.proofUnreceived:t.proofUnreceived=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.nextSequenceRecv&&null!==e.nextSequenceRecv?t.nextSequenceRecv=e.nextSequenceRecv:t.nextSequenceRecv=s.default.UZERO,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var P={};t.MsgTimeoutResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},P);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.packet&&c.Packet.encode(e.packet,t.uint32(10).fork()).ldelim(),0!==e.proofUnreceived.length&&t.uint32(18).bytes(e.proofUnreceived),0!==e.proofClose.length&&t.uint32(26).bytes(e.proofClose),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(34).fork()).ldelim(),e.nextSequenceRecv.isZero()||t.uint32(40).uint64(e.nextSequenceRecv),""!==e.signer&&t.uint32(50).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},T);for(o.proofUnreceived=new Uint8Array,o.proofClose=new Uint8Array;n.pos>>3){case 1:o.packet=c.Packet.decode(n,n.uint32());break;case 2:o.proofUnreceived=n.bytes();break;case 3:o.proofClose=n.bytes();break;case 4:o.proofHeight=l.Height.decode(n,n.uint32());break;case 5:o.nextSequenceRecv=n.uint64();break;case 6:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},T);return t.proofUnreceived=new Uint8Array,t.proofClose=new Uint8Array,void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromJSON(e.packet):t.packet=void 0,void 0!==e.proofUnreceived&&null!==e.proofUnreceived&&(t.proofUnreceived=N(e.proofUnreceived)),void 0!==e.proofClose&&null!==e.proofClose&&(t.proofClose=N(e.proofClose)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.nextSequenceRecv&&null!==e.nextSequenceRecv?t.nextSequenceRecv=s.default.fromString(e.nextSequenceRecv):t.nextSequenceRecv=s.default.UZERO,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.packet&&(t.packet=e.packet?c.Packet.toJSON(e.packet):void 0),void 0!==e.proofUnreceived&&(t.proofUnreceived=D(void 0!==e.proofUnreceived?e.proofUnreceived:new Uint8Array)),void 0!==e.proofClose&&(t.proofClose=D(void 0!==e.proofClose?e.proofClose:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.nextSequenceRecv&&(t.nextSequenceRecv=(e.nextSequenceRecv||s.default.UZERO).toString()),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},T);return void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromPartial(e.packet):t.packet=void 0,void 0!==e.proofUnreceived&&null!==e.proofUnreceived?t.proofUnreceived=e.proofUnreceived:t.proofUnreceived=new Uint8Array,void 0!==e.proofClose&&null!==e.proofClose?t.proofClose=e.proofClose:t.proofClose=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.nextSequenceRecv&&null!==e.nextSequenceRecv?t.nextSequenceRecv=e.nextSequenceRecv:t.nextSequenceRecv=s.default.UZERO,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var M={};t.MsgTimeoutOnCloseResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},M);n.pos1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return void 0!==e.packet&&c.Packet.encode(e.packet,t.uint32(10).fork()).ldelim(),0!==e.acknowledgement.length&&t.uint32(18).bytes(e.acknowledgement),0!==e.proofAcked.length&&t.uint32(26).bytes(e.proofAcked),void 0!==e.proofHeight&&l.Height.encode(e.proofHeight,t.uint32(34).fork()).ldelim(),""!==e.signer&&t.uint32(42).string(e.signer),t},decode:function(e,t){var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},E);for(o.acknowledgement=new Uint8Array,o.proofAcked=new Uint8Array;n.pos>>3){case 1:o.packet=c.Packet.decode(n,n.uint32());break;case 2:o.acknowledgement=n.bytes();break;case 3:o.proofAcked=n.bytes();break;case 4:o.proofHeight=l.Height.decode(n,n.uint32());break;case 5:o.signer=n.string();break;default:n.skipType(7&i)}}return o},fromJSON:function(e){var t=Object.assign({},E);return t.acknowledgement=new Uint8Array,t.proofAcked=new Uint8Array,void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromJSON(e.packet):t.packet=void 0,void 0!==e.acknowledgement&&null!==e.acknowledgement&&(t.acknowledgement=N(e.acknowledgement)),void 0!==e.proofAcked&&null!==e.proofAcked&&(t.proofAcked=N(e.proofAcked)),void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromJSON(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=String(e.signer):t.signer="",t},toJSON:function(e){var t={};return void 0!==e.packet&&(t.packet=e.packet?c.Packet.toJSON(e.packet):void 0),void 0!==e.acknowledgement&&(t.acknowledgement=D(void 0!==e.acknowledgement?e.acknowledgement:new Uint8Array)),void 0!==e.proofAcked&&(t.proofAcked=D(void 0!==e.proofAcked?e.proofAcked:new Uint8Array)),void 0!==e.proofHeight&&(t.proofHeight=e.proofHeight?l.Height.toJSON(e.proofHeight):void 0),void 0!==e.signer&&(t.signer=e.signer),t},fromPartial:function(e){var t=Object.assign({},E);return void 0!==e.packet&&null!==e.packet?t.packet=c.Packet.fromPartial(e.packet):t.packet=void 0,void 0!==e.acknowledgement&&null!==e.acknowledgement?t.acknowledgement=e.acknowledgement:t.acknowledgement=new Uint8Array,void 0!==e.proofAcked&&null!==e.proofAcked?t.proofAcked=e.proofAcked:t.proofAcked=new Uint8Array,void 0!==e.proofHeight&&null!==e.proofHeight?t.proofHeight=l.Height.fromPartial(e.proofHeight):t.proofHeight=void 0,void 0!==e.signer&&null!==e.signer?t.signer=e.signer:t.signer="",t}};var x={};t.MsgAcknowledgementResponse={encode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Writer.create();return t},decode:function(e,t){for(var n=e instanceof u.default.Reader?e:new u.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},x);n.pos=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=u(e,n);return n-1>=t&&(r|=u(e,n-1)<<4),r}function l(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,n,r){if("number"==typeof e)return this._initNumber(e,n,r);if("object"===t(e))return this._initArray(e,n,r);"hex"===n&&(n=16),o(n===(0|n)&&n>=2&&n<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;r-=3)a=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(r=0,i=0;r>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,u=0,c=n;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,d=67108863&u,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var h=c-p|0;l+=(a=(o=0|e.words[h])*(i=0|t.words[p])+d)/67108864|0,d=67108863&a}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var r=0,i=0,a=0;a>>24-r&16777215)||a!==this.length-1?d[6-u.length]+u+n:u+n,(r+=2)>=26&&(r-=26,a--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],l=p[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var v=h.modn(l).toString(e);n=(h=h.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}o(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return o(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var r=this.byteLength(),i=n||Math.max(1,r);o(r<=i,"byte array longer than desired length"),o(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(i),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){o("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){o("number"==typeof e&&e>=0);var n=e/26|0,r=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,b=m>>>13,y=0|a[3],w=8191&y,S=y>>>13,_=0|a[4],O=8191&_,k=_>>>13,A=0|a[5],P=8191&A,T=A>>>13,M=0|a[6],E=8191&M,x=M>>>13,C=0|a[7],R=8191&C,I=C>>>13,N=0|a[8],j=8191&N,D=N>>>13,B=0|a[9],U=8191&B,H=B>>>13,L=0|s[0],J=8191&L,z=L>>>13,V=0|s[1],G=8191&V,W=V>>>13,F=0|s[2],q=8191&F,Z=F>>>13,K=0|s[3],X=8191&K,Y=K>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,fe=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(d,J))|0)+((8191&(o=(o=Math.imul(d,z))+Math.imul(f,J)|0))<<13)|0;c=((i=Math.imul(f,z))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,J),o=(o=Math.imul(h,z))+Math.imul(v,J)|0,i=Math.imul(v,z);var ge=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(o=(o=o+Math.imul(d,W)|0)+Math.imul(f,G)|0))<<13)|0;c=((i=i+Math.imul(f,W)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,J),o=(o=Math.imul(g,z))+Math.imul(b,J)|0,i=Math.imul(b,z),r=r+Math.imul(h,G)|0,o=(o=o+Math.imul(h,W)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,W)|0;var be=(c+(r=r+Math.imul(d,q)|0)|0)+((8191&(o=(o=o+Math.imul(d,Z)|0)+Math.imul(f,q)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,J),o=(o=Math.imul(w,z))+Math.imul(S,J)|0,i=Math.imul(S,z),r=r+Math.imul(g,G)|0,o=(o=o+Math.imul(g,W)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,W)|0,r=r+Math.imul(h,q)|0,o=(o=o+Math.imul(h,Z)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,Z)|0;var ye=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,Y)|0)+Math.imul(f,X)|0))<<13)|0;c=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,z))+Math.imul(k,J)|0,i=Math.imul(k,z),r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,W)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,r=r+Math.imul(g,q)|0,o=(o=o+Math.imul(g,Z)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,Z)|0,r=r+Math.imul(h,X)|0,o=(o=o+Math.imul(h,Y)|0)+Math.imul(v,X)|0,i=i+Math.imul(v,Y)|0;var we=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(P,J),o=(o=Math.imul(P,z))+Math.imul(T,J)|0,i=Math.imul(T,z),r=r+Math.imul(O,G)|0,o=(o=o+Math.imul(O,W)|0)+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(w,q)|0,o=(o=o+Math.imul(w,Z)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(g,X)|0,o=(o=o+Math.imul(g,Y)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,Y)|0,r=r+Math.imul(h,$)|0,o=(o=o+Math.imul(h,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0;var Se=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(o=(o=o+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;c=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,z))+Math.imul(x,J)|0,i=Math.imul(x,z),r=r+Math.imul(P,G)|0,o=(o=o+Math.imul(P,W)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,W)|0,r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(S,X)|0,i=i+Math.imul(S,Y)|0,r=r+Math.imul(g,$)|0,o=(o=o+Math.imul(g,ee)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,ee)|0,r=r+Math.imul(h,ne)|0,o=(o=o+Math.imul(h,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0;var _e=(c+(r=r+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;c=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,z))+Math.imul(I,J)|0,i=Math.imul(I,z),r=r+Math.imul(E,G)|0,o=(o=o+Math.imul(E,W)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,W)|0,r=r+Math.imul(P,q)|0,o=(o=o+Math.imul(P,Z)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(O,X)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,r=r+Math.imul(g,ne)|0,o=(o=o+Math.imul(g,re)|0)+Math.imul(b,ne)|0,i=i+Math.imul(b,re)|0,r=r+Math.imul(h,ie)|0,o=(o=o+Math.imul(h,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0;var Oe=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(o=(o=o+Math.imul(d,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((i=i+Math.imul(f,ce)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,z))+Math.imul(D,J)|0,i=Math.imul(D,z),r=r+Math.imul(R,G)|0,o=(o=o+Math.imul(R,W)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,W)|0,r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,Z)|0,r=r+Math.imul(P,X)|0,o=(o=o+Math.imul(P,Y)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(w,ne)|0,o=(o=o+Math.imul(w,re)|0)+Math.imul(S,ne)|0,i=i+Math.imul(S,re)|0,r=r+Math.imul(g,ie)|0,o=(o=o+Math.imul(g,ae)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,ae)|0,r=r+Math.imul(h,ue)|0,o=(o=o+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0;var ke=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(U,J),o=(o=Math.imul(U,z))+Math.imul(H,J)|0,i=Math.imul(H,z),r=r+Math.imul(j,G)|0,o=(o=o+Math.imul(j,W)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,W)|0,r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(E,X)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,Y)|0,r=r+Math.imul(P,$)|0,o=(o=o+Math.imul(P,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,r=r+Math.imul(g,ue)|0,o=(o=o+Math.imul(g,ce)|0)+Math.imul(b,ue)|0,i=i+Math.imul(b,ce)|0,r=r+Math.imul(h,de)|0,o=(o=o+Math.imul(h,fe)|0)+Math.imul(v,de)|0,i=i+Math.imul(v,fe)|0;var Ae=(c+(r=r+Math.imul(d,he)|0)|0)+((8191&(o=(o=o+Math.imul(d,ve)|0)+Math.imul(f,he)|0))<<13)|0;c=((i=i+Math.imul(f,ve)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,G),o=(o=Math.imul(U,W))+Math.imul(H,G)|0,i=Math.imul(H,W),r=r+Math.imul(j,q)|0,o=(o=o+Math.imul(j,Z)|0)+Math.imul(D,q)|0,i=i+Math.imul(D,Z)|0,r=r+Math.imul(R,X)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(P,ne)|0,o=(o=o+Math.imul(P,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,i=i+Math.imul(S,ce)|0,r=r+Math.imul(g,de)|0,o=(o=o+Math.imul(g,fe)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,fe)|0;var Pe=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(o=(o=o+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((i=i+Math.imul(v,ve)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,q),o=(o=Math.imul(U,Z))+Math.imul(H,q)|0,i=Math.imul(H,Z),r=r+Math.imul(j,X)|0,o=(o=o+Math.imul(j,Y)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(P,ie)|0,o=(o=o+Math.imul(P,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(w,de)|0,o=(o=o+Math.imul(w,fe)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,fe)|0;var Te=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(o=(o=o+Math.imul(g,ve)|0)+Math.imul(b,he)|0))<<13)|0;c=((i=i+Math.imul(b,ve)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(U,X),o=(o=Math.imul(U,Y))+Math.imul(H,X)|0,i=Math.imul(H,Y),r=r+Math.imul(j,$)|0,o=(o=o+Math.imul(j,ee)|0)+Math.imul(D,$)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(P,ue)|0,o=(o=o+Math.imul(P,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,r=r+Math.imul(O,de)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(k,de)|0,i=i+Math.imul(k,fe)|0;var Me=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(o=(o=o+Math.imul(w,ve)|0)+Math.imul(S,he)|0))<<13)|0;c=((i=i+Math.imul(S,ve)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,$),o=(o=Math.imul(U,ee))+Math.imul(H,$)|0,i=Math.imul(H,ee),r=r+Math.imul(j,ne)|0,o=(o=o+Math.imul(j,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(E,ue)|0,o=(o=o+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,ce)|0,r=r+Math.imul(P,de)|0,o=(o=o+Math.imul(P,fe)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,fe)|0;var Ee=(c+(r=r+Math.imul(O,he)|0)|0)+((8191&(o=(o=o+Math.imul(O,ve)|0)+Math.imul(k,he)|0))<<13)|0;c=((i=i+Math.imul(k,ve)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(U,ne),o=(o=Math.imul(U,re))+Math.imul(H,ne)|0,i=Math.imul(H,re),r=r+Math.imul(j,ie)|0,o=(o=o+Math.imul(j,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(R,ue)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(I,ue)|0,i=i+Math.imul(I,ce)|0,r=r+Math.imul(E,de)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,fe)|0;var xe=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(o=(o=o+Math.imul(P,ve)|0)+Math.imul(T,he)|0))<<13)|0;c=((i=i+Math.imul(T,ve)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(H,ie)|0,i=Math.imul(H,ae),r=r+Math.imul(j,ue)|0,o=(o=o+Math.imul(j,ce)|0)+Math.imul(D,ue)|0,i=i+Math.imul(D,ce)|0,r=r+Math.imul(R,de)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(I,de)|0,i=i+Math.imul(I,fe)|0;var Ce=(c+(r=r+Math.imul(E,he)|0)|0)+((8191&(o=(o=o+Math.imul(E,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((i=i+Math.imul(x,ve)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(H,ue)|0,i=Math.imul(H,ce),r=r+Math.imul(j,de)|0,o=(o=o+Math.imul(j,fe)|0)+Math.imul(D,de)|0,i=i+Math.imul(D,fe)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(o=(o=o+Math.imul(R,ve)|0)+Math.imul(I,he)|0))<<13)|0;c=((i=i+Math.imul(I,ve)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(U,de),o=(o=Math.imul(U,fe))+Math.imul(H,de)|0,i=Math.imul(H,fe);var Ie=(c+(r=r+Math.imul(j,he)|0)|0)+((8191&(o=(o=o+Math.imul(j,ve)|0)+Math.imul(D,he)|0))<<13)|0;c=((i=i+Math.imul(D,ve)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Ne=(c+(r=Math.imul(U,he))|0)+((8191&(o=(o=Math.imul(U,ve))+Math.imul(H,he)|0))<<13)|0;return c=((i=Math.imul(H,ve))+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=be,u[3]=ye,u[4]=we,u[5]=Se,u[6]=_e,u[7]=Oe,u[8]=ke,u[9]=Ae,u[10]=Pe,u[11]=Te,u[12]=Me,u[13]=Ee,u[14]=xe,u[15]=Ce,u[16]=Re,u[17]=Ie,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(v=h),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=r/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,r=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=r);c--){var d=0|this.words[c];this.words[c]=l<<26-i|d>>>i,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return o(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){o("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,r=1<=0);var t=e%26,n=(e-t)/26;if(o(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(o("number"==typeof e),o(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[r+n]=67108863&i}for(;r>26,this.words[r+n]=67108863&i;if(0===s)return this.strip();for(o(-1===s),s=0,r=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,i=0|o.words[o.length-1];0!==(n=26-this._countBits(i))&&(o=o.ushln(n),r.iushln(n),i=0|o.words[o.length-1]);var s,u=r.length-o.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var f=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(f=Math.min(f/i|0,67108863),r._ishlnsubmul(o,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return o(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(r=s.div.neg()),"div"!==t&&(i=s.mod.neg(),n&&0!==i.negative&&i.iadd(e)),{div:r,mod:i}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(r=s.div.neg()),{div:r,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(i=s.mod.neg(),n&&0!==i.negative&&i.isub(e)),{div:s.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,i,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){o(e<=67108863);for(var t=(1<<26)%e,n=0,r=this.length-1;r>=0;r--)n=(t*n+(0|this.words[r]))%e;return n},a.prototype.idivn=function(e){o(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*t;this.words[n]=r/e|0,t=r%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){o(0===e.negative),o(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new a(1),i=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(l),i.isub(d)),r.iushrn(1),i.iushrn(1);for(var h=0,v=1;0==(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),r.isub(s),i.isub(u)):(n.isub(t),s.isub(r),u.isub(i))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){o(0===e.negative),o(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,i=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(u),i.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s)):(n.isub(t),s.isub(i))}return(r=0===t.cmpn(1)?i:s).cmpn(0)<0&&r.iadd(e),r},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){o("number"==typeof e);var t=e%26,n=(e-t)/26,r=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),o(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else o(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(w,y),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new S;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return b[e]=t,t},k.prototype._verify1=function(e){o(0===e.negative,"red works only with positives"),o(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){o(0==(e.negative|t.negative),"red works only with positives"),o(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(o(t%2==1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);o(!r.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,r),f=this.pow(e,r.addn(1).iushrn(1)),p=this.pow(e,r),h=i;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();o(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==i?(i<<=1,i|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[i]),s=0,i=0)):s=0}u=26}return o},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new A(e)},i(A,k),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(72)(e))},function(e,t,n){"use strict";var r=n(97),o=n(14);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o>6|192,n[r++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(o=0;o>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,a=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,a,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,o,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,a,s,u,c){var l=0,d=t;return l+=(d=d+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,o,i,a,s,u,c){return t+r+i+s+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if(n(23)){var o=n(74),i=n(13),a=n(15),s=n(0),u=n(150),c=n(214),l=n(55),d=n(88),f=n(81),p=n(40),h=n(90),v=n(57),m=n(22),g=n(274),b=n(84),y=n(63),w=n(46),S=n(103),_=n(17),O=n(26),k=n(203),A=n(85),P=n(49),T=n(86).f,M=n(205),E=n(82),x=n(21),C=n(66),R=n(140),I=n(121),N=n(208),j=n(105),D=n(145),B=n(87),U=n(207),H=n(263),L=n(25),J=n(48),z=L.f,V=J.f,G=i.RangeError,W=i.TypeError,F=i.Uint8Array,q=Array.prototype,Z=c.ArrayBuffer,K=c.DataView,X=C(0),Y=C(2),Q=C(3),$=C(4),ee=C(5),te=C(6),ne=R(!0),re=R(!1),oe=N.values,ie=N.keys,ae=N.entries,se=q.lastIndexOf,ue=q.reduce,ce=q.reduceRight,le=q.join,de=q.sort,fe=q.slice,pe=q.toString,he=q.toLocaleString,ve=x("iterator"),me=x("toStringTag"),ge=E("typed_constructor"),be=E("def_constructor"),ye=u.CONSTR,we=u.TYPED,Se=u.VIEW,_e=C(1,(function(e,t){return Te(I(e,e[be]),t)})),Oe=a((function(){return 1===new F(new Uint16Array([1]).buffer)[0]})),ke=!!F&&!!F.prototype.set&&a((function(){new F(1).set({})})),Ae=function(e,t){var n=v(e);if(n<0||n%t)throw G("Wrong offset!");return n},Pe=function(e){if(_(e)&&we in e)return e;throw W(e+" is not a typed array!")},Te=function(e,t){if(!_(e)||!(ge in e))throw W("It is not a typed array constructor!");return new e(t)},Me=function(e,t){return Ee(I(e,e[be]),t)},Ee=function(e,t){for(var n=0,r=t.length,o=Te(e,r);r>n;)o[n]=t[n++];return o},xe=function(e,t,n){z(e,t,{get:function(){return this._d[n]}})},Ce=function(e){var t,n,r,o,i,a,s=O(e),u=arguments.length,c=u>1?arguments[1]:void 0,d=void 0!==c,f=M(s);if(null!=f&&!k(f)){for(a=f.call(s),r=[],t=0;!(i=a.next()).done;t++)r.push(i.value);s=r}for(d&&u>2&&(c=l(c,arguments[2],2)),t=0,n=m(s.length),o=Te(this,n);n>t;t++)o[t]=d?c(s[t],t):s[t];return o},Re=function(){for(var e=0,t=arguments.length,n=Te(this,t);t>e;)n[e]=arguments[e++];return n},Ie=!!F&&a((function(){he.call(new F(1))})),Ne=function(){return he.apply(Ie?fe.call(Pe(this)):Pe(this),arguments)},je={copyWithin:function(e,t){return H.call(Pe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return $(Pe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return U.apply(Pe(this),arguments)},filter:function(e){return Me(this,Y(Pe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ee(Pe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return te(Pe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Pe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return re(Pe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ne(Pe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return le.apply(Pe(this),arguments)},lastIndexOf:function(e){return se.apply(Pe(this),arguments)},map:function(e){return _e(Pe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(Pe(this),arguments)},reduceRight:function(e){return ce.apply(Pe(this),arguments)},reverse:function(){for(var e,t=Pe(this).length,n=Math.floor(t/2),r=0;r1?arguments[1]:void 0)},sort:function(e){return de.call(Pe(this),e)},subarray:function(e,t){var n=Pe(this),r=n.length,o=b(e,r);return new(I(n,n[be]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,m((void 0===t?r:b(t,r))-o))}},De=function(e,t){return Me(this,fe.call(Pe(this),e,t))},Be=function(e){Pe(this);var t=Ae(arguments[1],1),n=this.length,r=O(e),o=m(r.length),i=0;if(o+t>n)throw G("Wrong length!");for(;i255?255:255&o),i.v[f](n*t+i.o,o,Oe)}(this,n,e)},enumerable:!0})};y?(h=n((function(e,n,r,o){d(e,h,c,"_d");var i,a,s,u,l=0,f=0;if(_(n)){if(!(n instanceof Z||"ArrayBuffer"==(u=S(n))||"SharedArrayBuffer"==u))return we in n?Ee(h,n):Ce.call(h,n);i=n,f=Ae(r,t);var v=n.byteLength;if(void 0===o){if(v%t)throw G("Wrong length!");if((a=v-f)<0)throw G("Wrong length!")}else if((a=m(o)*t)+f>v)throw G("Wrong length!");s=a/t}else s=g(n),i=new Z(a=s*t);for(p(e,"_d",{b:i,o:f,l:a,e:s,v:new K(i)});l1&&void 0!==arguments[1]?arguments[1]:i.default.Writer.create();return e.seconds.isZero()||t.uint32(8).int64(e.seconds),0!==e.nanos&&t.uint32(16).int32(e.nanos),t},decode:function(e,t){for(var n=e instanceof i.default.Reader?e:new i.default.Reader(e),r=void 0===t?n.len:n.pos+t,o=Object.assign({},a);n.pos>>3){case 1:o.seconds=n.int64();break;case 2:o.nanos=n.int32();break;default:n.skipType(7&s)}}return o},fromJSON:function(e){var t=Object.assign({},a);return void 0!==e.seconds&&null!==e.seconds?t.seconds=o.default.fromString(e.seconds):t.seconds=o.default.ZERO,void 0!==e.nanos&&null!==e.nanos?t.nanos=Number(e.nanos):t.nanos=0,t},toJSON:function(e){var t={};return void 0!==e.seconds&&(t.seconds=(e.seconds||o.default.ZERO).toString()),void 0!==e.nanos&&(t.nanos=e.nanos),t},fromPartial:function(e){var t=Object.assign({},a);return void 0!==e.seconds&&null!==e.seconds?t.seconds=e.seconds:t.seconds=o.default.ZERO,void 0!==e.nanos&&null!==e.nanos?t.nanos=e.nanos:t.nanos=0,t}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r,o=this&&this.__extends||(r=function(e,t){return(r=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)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ValConsPublicKey=t.LegacyAminoMultisigPublicKey=t.SimplePublicKey=t.PublicKey=void 0;var i=n(1),a=n(161),s=n(683),u=n(3),c=n(684),l=n(685),d=n(223),f=e.from("eb5ae98721","hex"),p=e.from("1624de6420","hex"),h=e.from("22c1f7e2","hex"),v=function(e){var t=Number.parseInt(e.toString());if(t>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[t]};!function(e){e.fromAmino=function(e){switch(e.type){case"tendermint/PubKeySecp256k1":return m.fromAmino(e);case"tendermint/PubKeyMultisigThreshold":return g.fromAmino(e);case"tendermint/PubKeyEd25519":return b.fromAmino(e)}},e.fromData=function(e){switch(e["@type"]){case"/cosmos.crypto.secp256k1.PubKey":return m.fromData(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":return g.fromData(e);case"/cosmos.crypto.ed25519.PubKey":return b.fromData(e)}},e.fromProto=function(e){var t=e.typeUrl;if("/cosmos.crypto.secp256k1.PubKey"===t)return m.unpackAny(e);if("/cosmos.crypto.multisig.LegacyAminoPubKey"===t)return g.unpackAny(e);if("/cosmos.crypto.ed25519.PubKey"===t)return b.unpackAny(e);throw new Error("Pubkey type ".concat(t," not recognized"))}}(t.PublicKey||(t.PublicKey={}));var m=function(t){function n(e){var n=t.call(this)||this;return n.key=e,n}return o(n,t),n.fromAmino=function(e){return new n(e.value)},n.prototype.toAmino=function(){return{type:"tendermint/PubKeySecp256k1",value:this.key}},n.fromData=function(e){return new n(e.key)},n.prototype.toData=function(){return{"@type":"/cosmos.crypto.secp256k1.PubKey",key:this.key}},n.fromProto=function(t){return new n(e.from(t.key).toString("base64"))},n.prototype.toProto=function(){return c.PubKey.fromPartial({key:e.from(this.key,"base64")})},n.prototype.packAny=function(){return u.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:c.PubKey.encode(this.toProto()).finish()})},n.unpackAny=function(e){return n.fromProto(c.PubKey.decode(e.value))},n.prototype.encodeAminoPubkey=function(){return e.concat([f,e.from(this.key,"base64")])},n.prototype.rawAddress=function(){var t=e.from(this.key,"base64");return(0,a.ripemd160)((0,a.sha256)(t))},n.prototype.address=function(){return d.bech32.encode("terra",d.bech32.toWords(this.rawAddress()))},n.prototype.pubkeyAddress=function(){return d.bech32.encode("terrapub",d.bech32.toWords(this.encodeAminoPubkey()))},n}(i.JSONSerializable);t.SimplePublicKey=m;var g=function(e){function t(t,n){var r=e.call(this)||this;return r.threshold=t,r.pubkeys=n,r}return o(t,e),t.prototype.encodeAminoPubkey=function(){var e=Array.from(h);e.push(8),e.push.apply(e,v(this.threshold));for(var t=0,n=this.pubkeys.map((function(e){return e.encodeAminoPubkey()}));t0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=p.bind(r);return o.listener=n,r.wrapFn=o,o}function v(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var c=u.length,l=g(u,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return v(this,e,!0)},u.prototype.rawListeners=function(e){return v(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},u.prototype.listenerCount=m,u.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(60),o=null;function i(e){if(r.a.useDeprecatedSynchronousErrorHandling){var t=!o;if(t&&(o={errorThrown:!1,error:null}),e(),t){var n=o,i=n.errorThrown,a=n.error;if(o=null,i)throw a}}else e()}function a(e){r.a.useDeprecatedSynchronousErrorHandling&&o&&(o.errorThrown=!0,o.error=e)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(248),o=n(191);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(57),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(12),o=n(249),i=n(191),a=n(190)("IE_PROTO"),s=function(){},u=function(){var e,t=n(188)("iframe"),r=i.length;for(t.style.display="none",n(192).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("